Browse Source

do not create a surface if the window provided is invalid

pull/9408/head
Emmanuel Hansen 4 years ago
parent
commit
ae7a532d06
  1. 2
      src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs

2
src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs

@ -50,6 +50,8 @@ namespace Avalonia.OpenGL.Egl
{
using (PrimaryContext.MakeCurrent())
{
if(window == IntPtr.Zero)
throw new OpenGlException($"Window {window} is invalid.");
var s = Display.EglInterface.CreateWindowSurface(Display.Handle, Display.Config, window,
new[] { EGL_NONE, EGL_NONE });
if (s == IntPtr.Zero)

Loading…
Cancel
Save