summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-13 15:52:36 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-13 15:52:36 +0100
commitcc178b9e4db835a18a8ffb1ebd715e7d4e0ca033 (patch)
treeafbd197fe7643327b3d9b861f67c2f62bd6b7ecd
parent4c1a858d5d50eb0dce14899b791bcc07b92be73d (diff)
parented5c9a07d7bcc1f59c58106350007b0564df7556 (diff)
Merge pull request #68584 from Sauermann/fix-native-handle-crash
Fix gl_manager nullptr crash
-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: {