ソースを参照

Fix crash when trying to access the guid of an unavailable Gamepad.

Throws an error now.

(cherry picked from commit 02a8604906b1f50000f96e2f8dbd0d50a162ab6f)
Andreas Haas 9 年 前
コミット
cd6afd5f1d
1 ファイル変更1 行追加0 行削除
  1. 1 0
      main/input_default.cpp

+ 1 - 0
main/input_default.cpp

@@ -1055,6 +1055,7 @@ bool InputDefault::is_joy_mapped(int p_device) {
 }
 
 String InputDefault::get_joy_guid_remapped(int p_device) const {
+	ERR_FAIL_COND_V(!joy_names.has(p_device), "");
 	return joy_names[p_device].uid;
 }