]> source.dussan.org Git - nextcloud-server.git/commitdiff
call ajax scan only if a user is logged in - otherwise we'll get a 500
authorThomas Mueller <thomas.mueller@tmit.eu>
Mon, 28 Jan 2013 08:48:03 +0000 (09:48 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Mon, 28 Jan 2013 08:48:03 +0000 (09:48 +0100)
apps/files/js/files.js

index 6486468eafd4b231f3489064a430e6f99fd515e1..64866aea3943864f03dc9ec6b45a3d4da5c81531 100644 (file)
@@ -667,11 +667,13 @@ $(document).ready(function() {
        });
 
        //check if we need to scan the filesystem
-       $.get(OC.filePath('files','ajax','scan.php'),{checkonly:'true'}, function(response) {
-               if(response.data.done){
-                       scanFiles();
-               }
-       }, "json");
+       if (OC.currentUser) {
+               $.get(OC.filePath('files','ajax','scan.php'),{checkonly:'true'}, function(response) {
+                       if(response.data.done){
+                               scanFiles();
+                       }
+               }, "json");
+       }
 
        var lastWidth = 0;
        var breadcrumbs = [];