Skip to content

Commit

Permalink
Merge pull request #11625 from owncloud/fix-setup-due-to-some-race-co…
Browse files Browse the repository at this point in the history
…ndition

Add a try catch block
  • Loading branch information
Vincent Petry committed Oct 16, 2014
2 parents 1ebeb67 + 53e0cf2 commit 0412f83
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/private/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1101,13 +1101,17 @@ public static function getAppVersions() {
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;
}


Expand Down

0 comments on commit 0412f83

Please sign in to comment.