From c98ca4e959fac4d98d22e1b459b438d9af6591ce Mon Sep 17 00:00:00 2001 From: lucicam Date: Thu, 25 Mar 2021 15:49:17 +0200 Subject: [PATCH] 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. --- servers/xr_server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/xr_server.cpp b/servers/xr_server.cpp index 2acc2e398c2..7087ae49475 100644 --- a/servers/xr_server.cpp +++ b/servers/xr_server.cpp @@ -311,6 +311,7 @@ Ref XRServer::get_primary_interface() const { }; void XRServer::set_primary_interface(const Ref &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());