浏览代码

Added p_shape check to avoid engine crush

KingCakeTheFruity 3 年之前
父节点
当前提交
29a2809d21
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      core/input/input.cpp

+ 2 - 0
core/input/input.cpp

@@ -851,6 +851,8 @@ void Input::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, co
 		return;
 	}
 
+	ERR_FAIL_INDEX(p_shape, CursorShape::CURSOR_MAX);
+
 	set_custom_mouse_cursor_func(p_cursor, p_shape, p_hotspot);
 }