diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-22 13:09:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-22 13:09:34 +0200 |
commit | 5d2d24202d5e50c44fca1fc706d4677ebda0fc2f (patch) | |
tree | c5c3310824316fc889fc40b552dede664b11d449 /editor | |
parent | 3b3a55ca04331e85cc24ac315b60e7ad4aeb17df (diff) | |
parent | ea9660e1cf8de10ef691e37d562da19ab518a1fb (diff) |
Merge pull request #48927 from KoBeWi/I_fixed_your_left
Fix usage of String.left()
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_inspector.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 29cc4c3c46..c730277069 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1824,7 +1824,13 @@ void EditorInspector::update_tree() { } } - String path = basename.left(basename.rfind("/")); + String path; + { + int idx = basename.rfind("/"); + if (idx > -1) { + path = basename.left(idx); + } + } if (use_filter && filter != "") { String cat = path; |