Browse Source

Merge pull request #60208 from Magorx/input-set-custom-mouse-cursor-fix

Added p_shape check to avoid engine crash in DisplayServer
Rémi Verschelde 3 years ago
parent
commit
bd9ba4bd10
1 changed files with 2 additions and 0 deletions
  1. 2 0
      core/input/input.cpp

+ 2 - 0
core/input/input.cpp

@@ -855,6 +855,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);
 }