runDialog: Don't return from finally block

Control flow statements like return, break or continue are considered
unsafe in finally blocks, as they take precendence over any control
flow statement in the try and catch blocks, which may be unexpected.

This isn't the case here as the statement in the finally block is the
only one, but we can just as well avoid the finally block altogether
and use a regular return statement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606
This commit is contained in:
Florian Müllner 2019-02-04 13:22:41 +01:00 committed by Georges Basile Stavracas Neto
parent b3736f45e6
commit 2c1a81f448

View File

@ -169,9 +169,8 @@ class RunDialog extends ModalDialog.ModalDialog {
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) &&
!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_DIRECTORY))
log(e);
} finally {
return results;
}
return results;
});
let results = someResults.reduce((a, b) => a.concat(b), []);