summaryrefslogtreecommitdiff
path: root/scene/3d/navigation_link_3d.cpp
diff options
context:
space:
mode:
authorAdam Scott <ascott.ca@gmail.com>2022-12-12 12:42:37 -0500
committerAdam Scott <ascott.ca@gmail.com>2022-12-29 16:23:38 -0500
commitea33001b95d57f7b400d78d4b20bef23293d9077 (patch)
tree71ac58a0294e7417e42601cd46fccaac4bcbbe2e /scene/3d/navigation_link_3d.cpp
parenta75493091823020d858fabadbfa5994da0d658cb (diff)
Add safety-checks before some servers `free()`
Diffstat (limited to 'scene/3d/navigation_link_3d.cpp')
-rw-r--r--scene/3d/navigation_link_3d.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/3d/navigation_link_3d.cpp b/scene/3d/navigation_link_3d.cpp
index bee7c7f39b..009abfc8fd 100644
--- a/scene/3d/navigation_link_3d.cpp
+++ b/scene/3d/navigation_link_3d.cpp
@@ -227,10 +227,12 @@ NavigationLink3D::NavigationLink3D() {
}
NavigationLink3D::~NavigationLink3D() {
+ ERR_FAIL_NULL(NavigationServer3D::get_singleton());
NavigationServer3D::get_singleton()->free(link);
link = RID();
#ifdef DEBUG_ENABLED
+ ERR_FAIL_NULL(RenderingServer::get_singleton());
if (debug_instance.is_valid()) {
RenderingServer::get_singleton()->free(debug_instance);
}