Explorar el Código

Merge pull request #105953 from youngminz/ios-input-singleton-null-check

[iOS] Prevent startup crash with Input singleton null check
Rémi Verschelde hace 2 meses
padre
commit
0dbd71bffe
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      drivers/apple_embedded/display_server_apple_embedded.mm

+ 6 - 1
drivers/apple_embedded/display_server_apple_embedded.mm

@@ -291,7 +291,12 @@ void DisplayServerAppleEmbedded::touch_drag(int p_idx, int p_prev_x, int p_prev_
 }
 
 void DisplayServerAppleEmbedded::perform_event(const Ref<InputEvent> &p_event) {
-	Input::get_singleton()->parse_input_event(p_event);
+	Input *input_singleton = Input::get_singleton();
+	if (input_singleton == nullptr) {
+		return;
+	}
+
+	input_singleton->parse_input_event(p_event);
 }
 
 void DisplayServerAppleEmbedded::touches_canceled(int p_idx) {