From 57ceff19b90b3326ed5a830f2f8f5e80037cf3d7 Mon Sep 17 00:00:00 2001 From: Tzach Shabtay Date: Sun, 11 Dec 2016 17:47:26 -0500 Subject: [PATCH] Android- Fix crash when querying for surface when window info was not created yet MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- src/OpenTK/Platform/Android/AndroidGraphicsContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTK/Platform/Android/AndroidGraphicsContext.cs b/src/OpenTK/Platform/Android/AndroidGraphicsContext.cs index f4fd54d..c4edb69 100644 --- a/src/OpenTK/Platform/Android/AndroidGraphicsContext.cs +++ b/src/OpenTK/Platform/Android/AndroidGraphicsContext.cs @@ -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 { -- 2.7.4