From b22c1dd0f71ab53304551249a8750870ecb1b504 Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Wed, 23 May 2018 00:15:35 -0600 Subject: [PATCH] cppcheck - defensive programming on i index check order --- editor/editor_properties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 0625aeee54a..0ce883ccd5b 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -500,7 +500,7 @@ public: virtual String get_tooltip(const Point2 &p_pos) const { for (int i = 0; i < flag_rects.size(); i++) { - if (flag_rects[i].has_point(p_pos) && i < names.size()) { + if (i < names.size() && flag_rects[i].has_point(p_pos)) { return names[i]; } }