summaryrefslogtreecommitdiff
path: root/platform/linuxbsd
diff options
context:
space:
mode:
authorzCubed3 <liamr2023@gmail.com>2022-10-27 13:52:38 -0700
committerzCubed3 <liamr2023@gmail.com>2022-10-27 15:45:21 -0700
commite7091d07cdd15f9ef3c0083a02532efa2866298c (patch)
tree0d7b252757913dd8074e6076a4e74cd48bd42fac /platform/linuxbsd
parent4dc2c8ae6fe954f8c5c6627803f0a087ee1a2488 (diff)
Fix OS.get_video_adapter_driver_info crash
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index 995a904398..11b667fcef 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -246,6 +246,10 @@ String OS_LinuxBSD::get_version() const {
}
Vector<String> OS_LinuxBSD::get_video_adapter_driver_info() const {
+ if (RenderingServer::get_singleton()->get_rendering_device() == nullptr) {
+ return Vector<String>();
+ }
+
const String rendering_device_name = RenderingServer::get_singleton()->get_rendering_device()->get_device_name(); // e.g. `NVIDIA GeForce GTX 970`
const String rendering_device_vendor = RenderingServer::get_singleton()->get_rendering_device()->get_device_vendor_name(); // e.g. `NVIDIA`
const String card_name = rendering_device_name.trim_prefix(rendering_device_vendor).strip_edges(); // -> `GeForce GTX 970`