diff options
author | kobewi <kobewi4e@gmail.com> | 2021-05-21 15:17:43 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2021-05-21 23:01:44 +0200 |
commit | ea9660e1cf8de10ef691e37d562da19ab518a1fb (patch) | |
tree | 204590ebd6ac91fa345b83d7a08d68abe050da2f /editor | |
parent | 8c2beeea907cb39baac20df198392ae4fdf64029 (diff) |
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; |