diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-12-01 00:59:49 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-12-01 00:59:49 +0100 |
commit | 702444b2422326388e494091e815fd3d9b03cc87 (patch) | |
tree | 5a080d39f949828d80326b69bcf3ce64160ac8da /lib/files/cache/upgrade.php | |
parent | dbbb357f62c1ba86bdff0fbe63e4cea9bc2977fc (diff) | |
download | nextcloud-server-702444b2422326388e494091e815fd3d9b03cc87.tar.gz nextcloud-server-702444b2422326388e494091e815fd3d9b03cc87.zip |
fail gracefully when no old filecache is present during upgrade
Diffstat (limited to 'lib/files/cache/upgrade.php')
-rw-r--r-- | lib/files/cache/upgrade.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php index 5be04b42070..899f6f7ac83 100644 --- a/lib/files/cache/upgrade.php +++ b/lib/files/cache/upgrade.php @@ -16,7 +16,14 @@ class Upgrade { VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); $oldEntriesQuery = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` ORDER BY `id` ASC'); //sort ascending to ensure the parent gets inserted before a child - $oldEntriesResult = $oldEntriesQuery->execute(); + try{ + $oldEntriesResult = $oldEntriesQuery->execute(); + }catch(\Exception $e){ + return; + } + if(!$oldEntriesResult){ + return; + } while ($row = $oldEntriesResult->fetchRow()) { list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($row['path']); |