summaryrefslogtreecommitdiff
path: root/scene/gui/file_dialog.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-09-12 11:57:49 +0200
committerGitHub <noreply@github.com>2017-09-12 11:57:49 +0200
commitcf941fdc357791a93bd9ab9eaf16898e0c218ff3 (patch)
tree546d046bffd826359c85240ae4562ef5df734e86 /scene/gui/file_dialog.cpp
parent84ccda4e1d6f9a63b689167887f7d329cdc5dffa (diff)
parent8230bf0a2f39f0849b670d26067207c45edcca1a (diff)
Merge pull request #11026 from hpvb/fix-assign-in-if
Remove assignment and declarations in if statements
Diffstat (limited to 'scene/gui/file_dialog.cpp')
-rw-r--r--scene/gui/file_dialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 990c0f3d96..87a232e766 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -183,8 +183,8 @@ void FileDialog::_action_pressed() {
String path = dir_access->get_current_dir();
path = path.replace("\\", "/");
-
- if (TreeItem *item = tree->get_selected()) {
+ TreeItem *item = tree->get_selected();
+ if (item) {
Dictionary d = item->get_metadata(0);
if (d["dir"]) {
path = path.plus_file(d["name"]);