You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-05 17:15:09 +00:00
Merge pull request #19115 from firefly2442/cppcheck-defensive
cppcheck - defensive programming on i index check order
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user