summaryrefslogtreecommitdiff
path: root/platform/linuxbsd/x11/display_server_x11.cpp
diff options
context:
space:
mode:
authorMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-11-13 00:48:45 +0100
committerMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-11-13 00:48:45 +0100
commited5c9a07d7bcc1f59c58106350007b0564df7556 (patch)
tree8d4b8b392bc046f904dfe5a9461323a3807f8bfd /platform/linuxbsd/x11/display_server_x11.cpp
parentc17f17eb98188a7134c85bdbdf0123127c462046 (diff)
Fix gl_manager nullptr crash
Add a nullptr-check, before accessing gl_manager
Diffstat (limited to 'platform/linuxbsd/x11/display_server_x11.cpp')
-rw-r--r--platform/linuxbsd/x11/display_server_x11.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index 2e60ad8f45..b86bc10643 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -1319,7 +1319,10 @@ int64_t DisplayServerX11::window_get_native_handle(HandleType p_handle_type, Win
}
#ifdef GLES3_ENABLED
case OPENGL_CONTEXT: {
- return (int64_t)gl_manager->get_glx_context(p_window);
+ if (gl_manager) {
+ return (int64_t)gl_manager->get_glx_context(p_window);
+ }
+ return 0;
}
#endif
default: {