diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-29 11:52:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 11:52:30 +0200 |
commit | 76ba2ffef1f42273f6823de9ea14fefb201a0dd0 (patch) | |
tree | 464e4c5a5ac5a6663bd12478c8ce112346eca1e0 | |
parent | 51f9b41afde012e34a50d6ee82b77c40c3a93ee1 (diff) | |
parent | c5b65236d8b6cf463abb98bc19eeea4f6ec4098e (diff) |
Merge pull request #49993 from groud/fix_debbuger_crash
Fixes crash in case no column in tree is expanded and has minimum size
-rw-r--r-- | scene/gui/tree.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 521d37060a..aac15cd9a5 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3885,8 +3885,11 @@ int Tree::get_column_width(int p_column) const { } ERR_FAIL_COND_V(expanding_columns == 0, -1); // shouldn't happen - - return expand_area * get_column_minimum_width(p_column) / expanding_total; + if (expanding_total == 0) { + return 0; + } else { + return expand_area * get_column_minimum_width(p_column) / expanding_total; + } } else { return get_column_minimum_width(p_column); } |