Skip to content

Commit 4b38457

Browse files
committed
bug fixes
1 parent 883b7a2 commit 4b38457

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

js/common/file_dialog.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ class FileDialog extends GenericModal {
741741

742742
_getSelectedFilePath() {
743743
// Get the paths of all selected files. These will not be valid paths to move to.
744-
paths = [];
744+
let paths = [];
745745
let files = this._getSelectedFilesInfo();
746746
if (files.length < 1) return [];
747747

@@ -762,10 +762,14 @@ class FileDialog extends GenericModal {
762762
const fileNameField = this._getElement('fileNameField');
763763
let filetype, filename;
764764
let selectedItem = this._getSelectedFiles();
765-
if (selectedItem.length != 1) {
765+
if (selectedItem.length > 1) {
766766
return;
767767
}
768-
selectedItem = selectedItem[0];
768+
if (selectedItem.length == 1) {
769+
selectedItem = selectedItem[0];
770+
} else {
771+
selectedItem = null;
772+
}
769773

770774
if (item !== undefined) {
771775
filetype = item.getAttribute("data-type");

0 commit comments

Comments
 (0)