summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/tests/js/filelistSpec.js5
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index bcf6f991c50..8722ad7d27c 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1489,7 +1489,7 @@
return false;
}
- if (status === 404 || status === 405) {
+ if (status === 400 || status === 404 || status === 405) {
// go back home
this.changeDirectory('/');
return false;
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index e23a42ec4e9..47cfdbafcf9 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1357,6 +1357,11 @@ describe('OCA.Files.FileList tests', function() {
deferredList.reject(404);
expect(fileList.getCurrentDirectory()).toEqual('/');
});
+ it('switches to root dir when current directory returns 400', function() {
+ fileList.changeDirectory('/unexist');
+ deferredList.reject(400);
+ expect(fileList.getCurrentDirectory()).toEqual('/');
+ });
it('switches to root dir when current directory returns 405', function() {
fileList.changeDirectory('/unexist');
deferredList.reject(405);