Skip to content

Commit 4babce9

Browse files
committed
fix testing for undefined
Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
1 parent ab9b16e commit 4babce9

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

apps/files/js/fileactions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@
649649
actions = OC.dialogs.FILEPICKER_TYPE_COPY_MOVE;
650650
}
651651
var dialogDir = context.dir;
652-
if (context.fileList.dirInfo.dirLastCopiedTo != undefined) {
652+
if (typeof context.fileList.dirInfo.dirLastCopiedTo !== 'undefined') {
653653
dialogDir = context.fileList.dirInfo.dirLastCopiedTo;
654654
}
655655
OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {

apps/files/js/filelist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@
919919

920920
var actions = this.isSelectedMovable() ? OC.dialogs.FILEPICKER_TYPE_COPY_MOVE : OC.dialogs.FILEPICKER_TYPE_COPY;
921921
var dialogDir = self.getCurrentDirectory();
922-
if (self.dirInfo.dirLastCopiedTo != undefined) {
922+
if (typeof self.dirInfo.dirLastCopiedTo !== 'undefined') {
923923
dialogDir = self.dirInfo.dirLastCopiedTo;
924924
}
925925
OC.dialogs.filepicker(t('files', 'Choose target folder'), function(targetPath, type) {

core/js/oc-dialogs.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ var OCdialogs = {
213213
this.filepicker.loading = true;
214214
this.filepicker.filesClient = (OCA.Sharing && OCA.Sharing.PublicApp && OCA.Sharing.PublicApp.fileList)? OCA.Sharing.PublicApp.fileList.filesClient: OC.Files.getClient();
215215

216-
if (path == undefined) {
217-
path = '';
218-
}
216+
path = path || '';
219217

220218
$.when(this._getFilePickerTemplate()).then(function($tmpl) {
221219
self.filepicker.loading = false;

0 commit comments

Comments
 (0)