Browse Source

Added p_shape check to avoid engine crush

(cherry picked from commit 29a2809d2120bc740f948e4134e839557e689724)
KingCakeTheFruity 3 years ago
parent
commit
198d147f8e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      main/input_default.cpp

+ 2 - 0
main/input_default.cpp

@@ -686,6 +686,8 @@ void InputDefault::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_sh
 		return;
 		return;
 	}
 	}
 
 
+	ERR_FAIL_INDEX(p_shape, Input::CURSOR_MAX);
+
 	OS::get_singleton()->set_custom_mouse_cursor(p_cursor, (OS::CursorShape)p_shape, p_hotspot);
 	OS::get_singleton()->set_custom_mouse_cursor(p_cursor, (OS::CursorShape)p_shape, p_hotspot);
 }
 }