소스 검색

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.
lucicam 4 년 전
부모
커밋
7c0255695d
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      servers/arvr_server.cpp

+ 1 - 0
servers/arvr_server.cpp

@@ -318,6 +318,7 @@ Ref<ARVRInterface> ARVRServer::get_primary_interface() const {
 };
 
 void ARVRServer::set_primary_interface(const Ref<ARVRInterface> &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());