Android- Fix crash when querying for surface when window info was not created yet

HasSurface is called by ReadyToRender property to query if the surface
was created, but it’s possible that the window info was not created
yet, added a missing null check.
This commit is contained in:
Tzach Shabtay 2016-12-11 17:47:26 -05:00
parent 1581ac7b8a
commit 57ceff19b9

View file

@ -57,7 +57,7 @@ namespace OpenTK.Platform.Android {
public bool HasSurface
{
get { return eglWindowInfo.Surface != IntPtr.Zero; }
get { return eglWindowInfo != null && eglWindowInfo.Surface != IntPtr.Zero; }
}
public ISurfaceHolder Holder {