summaryrefslogtreecommitdiff
path: root/servers/rendering_server.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-20 11:44:10 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-20 11:44:10 +0100
commit4a52fb828fd9569f1dd9a5dff625e8703219ffa9 (patch)
treecf1c70811666c7c490cb582f4f351fd89cc69edd /servers/rendering_server.cpp
parentd5d83eefd30b42fa5e2ace98bf3990aba575b2ac (diff)
parent9ce9c959abb993b1c4edf242ff56ed5f568db791 (diff)
Merge pull request #68884 from dzil123/create_local_rendering_device_null_check_docs
RenderingServer::create_local_rendering_device - Add null check and update docs
Diffstat (limited to 'servers/rendering_server.cpp')
-rw-r--r--servers/rendering_server.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp
index a18a9d7460..6cb1684baf 100644
--- a/servers/rendering_server.cpp
+++ b/servers/rendering_server.cpp
@@ -1476,7 +1476,11 @@ RenderingDevice *RenderingServer::get_rendering_device() const {
}
RenderingDevice *RenderingServer::create_local_rendering_device() const {
- return RenderingDevice::get_singleton()->create_local_device();
+ RenderingDevice *device = RenderingDevice::get_singleton();
+ if (!device) {
+ return nullptr;
+ }
+ return device->create_local_device();
}
static Vector<Ref<Image>> _get_imgvec(const TypedArray<Image> &p_layers) {