Merge pull request #11625 from owncloud/fix-setup-due-to-some-race-condition
Add a try catch block
This commit is contained in:
commit
0412f83035
1 changed files with 10 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue