diff options
| author | Hein-Pieter van Braam | 2017-09-06 23:50:18 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2017-09-08 14:59:15 +0200 |
| commit | 8230bf0a2f39f0849b670d26067207c45edcca1a (patch) | |
| tree | 42f598d11fab7f1449d0cace0f991f546bd72e72 /scene/gui/file_dialog.cpp | |
| parent | d1cb73b47a17de830d9474026ffa7b3587cfbc68 (diff) | |
| download | godot-8230bf0a2f39f0849b670d26067207c45edcca1a.tar.gz godot-8230bf0a2f39f0849b670d26067207c45edcca1a.tar.zst godot-8230bf0a2f39f0849b670d26067207c45edcca1a.zip | |
Remove assignment and declarations in if statements
After discussing with @reduz and @akien-mga it was decided that we do
not allow assignments or declarations in if statements. This PR removes
the instances of this I could find by automated means.
Diffstat (limited to '')
| -rw-r--r-- | scene/gui/file_dialog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 990c0f3d9..87a232e76 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"]); |
