From 43a9aa4349df4a842e7a5df509f8d7312509dfad Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 3 Jan 2024 03:43:27 -0800 Subject: [PATCH] Do not crash on IsCurrent checks (#14089) --- src/Avalonia.OpenGL/Egl/EglContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.OpenGL/Egl/EglContext.cs b/src/Avalonia.OpenGL/Egl/EglContext.cs index 137e9a18d3..ae729968ba 100644 --- a/src/Avalonia.OpenGL/Egl/EglContext.cs +++ b/src/Avalonia.OpenGL/Egl/EglContext.cs @@ -154,7 +154,7 @@ namespace Avalonia.OpenGL.Egl ShareWith = _sharedWith ?? this }); - public bool IsCurrent => _egl.GetCurrentDisplay() == _disp.Handle && _egl.GetCurrentContext() == Context; + public bool IsCurrent => _context != default && _egl.GetCurrentDisplay() == _disp.Handle && _egl.GetCurrentContext() == _context; public void Dispose() {