From 7c0255695dfcc03a0e87233e63381079fc86d03d Mon Sep 17 00:00:00 2001 From: lucicam Date: Thu, 25 Mar 2021 11:27:32 +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. --- servers/arvr_server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp index 641d23f9350..cf1936f8ac9 100644 --- a/servers/arvr_server.cpp +++ b/servers/arvr_server.cpp @@ -318,6 +318,7 @@ Ref ARVRServer::get_primary_interface() const { }; void ARVRServer::set_primary_interface(const Ref &p_primary_interface) { + ERR_FAIL_COND(p_primary_interface.is_null()); primary_interface = p_primary_interface; print_verbose("ARVR: Primary interface set to: " + primary_interface->get_name());