summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-16 22:27:08 +0200
committerVincent Petry <pvince81@owncloud.com>2014-10-16 22:27:08 +0200
commit0412f830352fe3b00a05de881535666a3530c31b (patch)
tree784169e438d50eab45a56328402bc0a184299eed
parent1ebeb6792eca53f34c2ad5a9c5eed7850b40fbb6 (diff)
parent53e0cf2f74af236f6121b5aedfd1e06d93902674 (diff)
downloadnextcloud-server-0412f830352fe3b00a05de881535666a3530c31b.tar.gz
nextcloud-server-0412f830352fe3b00a05de881535666a3530c31b.zip
Merge pull request #11625 from owncloud/fix-setup-due-to-some-race-condition
Add a try catch block
-rw-r--r--lib/private/app.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 95a8a7302d9..faaadef3857 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -1101,13 +1101,17 @@ class OC_App {
return $versions; // when function is used besides in checkUpgrade
}
$versions = array();
- $query = OC_DB::prepare('SELECT `appid`, `configvalue` FROM `*PREFIX*appconfig`'
- . ' WHERE `configkey` = \'installed_version\'');
- $result = $query->execute();
- while ($row = $result->fetchRow()) {
- $versions[$row['appid']] = $row['configvalue'];
+ try {
+ $query = OC_DB::prepare('SELECT `appid`, `configvalue` FROM `*PREFIX*appconfig`'
+ . ' WHERE `configkey` = \'installed_version\'');
+ $result = $query->execute();
+ while ($row = $result->fetchRow()) {
+ $versions[$row['appid']] = $row['configvalue'];
+ }
+ return $versions;
+ } catch (\Exception $e) {
+ return array();
}
- return $versions;
}