]> source.dussan.org Git - nextcloud-server.git/commitdiff
skip teardown if cache has not been set up
authorJörn Friedrich Dreyer <jfd@butonic.de>
Thu, 20 Jun 2013 09:41:07 +0000 (11:41 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Thu, 20 Jun 2013 09:41:07 +0000 (11:41 +0200)
tests/lib/files/cache/scanner.php

index 3dacefa2b801dab56f6a34b8d26ddfb4f5312218..0e3aaa2d76f22e6e8c0ff8eb79879a8dc90a9366 100644 (file)
@@ -151,9 +151,11 @@ class Scanner extends \PHPUnit_Framework_TestCase {
        }
 
        function tearDown() {
-               $ids = $this->cache->getAll();
-               $permissionsCache = $this->storage->getPermissionsCache();
-               $permissionsCache->removeMultiple($ids, \OC_User::getUser());
-               $this->cache->clear();
+               if ($this->cache) {
+                       $ids = $this->cache->getAll();
+                       $permissionsCache = $this->storage->getPermissionsCache();
+                       $permissionsCache->removeMultiple($ids, \OC_User::getUser());
+                       $this->cache->clear();
+               }
        }
 }