Skip to content

Commit

Permalink
Android- Fix crash when querying for surface when window info was not…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
tzachshabtay committed Dec 11, 2016
1 parent 1581ac7 commit 57ceff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OpenTK/Platform/Android/AndroidGraphicsContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class AndroidWindow : IWindowInfo, IDisposable

public bool HasSurface
{
get { return eglWindowInfo.Surface != IntPtr.Zero; }
get { return eglWindowInfo != null && eglWindowInfo.Surface != IntPtr.Zero; }
}

public ISurfaceHolder Holder {
Expand Down

0 comments on commit 57ceff1

Please sign in to comment.