summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlucicam <luci1093@gmail.com>2021-03-25 15:49:17 +0200
committerlucicam <luci1093@gmail.com>2021-03-25 17:36:22 +0200
commitc98ca4e959fac4d98d22e1b459b438d9af6591ce (patch)
tree20f2f3d70de05b6cfd26e445ce7a1aefcaa53000
parent538daf673107922e3af99ad6c22ff3f3baf883cb (diff)
Fix failure in set_primary_interface when parameter is null
The program would fail if the parameter is passed as null in set_primary_interface because in the print_verbose, the get_namea) method is called on the parameter and this causes a failure if the parameter that was passed is null. Same fix was done in 3.x also and it seems to be present in master too.
-rw-r--r--servers/xr_server.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/xr_server.cpp b/servers/xr_server.cpp
index 2acc2e398c..7087ae4947 100644
--- a/servers/xr_server.cpp
+++ b/servers/xr_server.cpp
@@ -311,6 +311,7 @@ Ref<XRInterface> XRServer::get_primary_interface() const {
};
void XRServer::set_primary_interface(const Ref<XRInterface> &p_primary_interface) {
+ ERR_FAIL_COND(p_primary_interface.is_null());
primary_interface = p_primary_interface;
print_verbose("XR: Primary interface set to: " + primary_interface->get_name());