Add a try catch block
This function might also be called before ownCloud is setup which results in a PHP fatal error. We therefore should gracefully catch errors in there.
This commit is contained in:
parent
1ebeb6792e
commit
53e0cf2f74
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
|
return $versions; // when function is used besides in checkUpgrade
|
||||||
}
|
}
|
||||||
$versions = array();
|
$versions = array();
|
||||||
$query = OC_DB::prepare('SELECT `appid`, `configvalue` FROM `*PREFIX*appconfig`'
|
try {
|
||||||
. ' WHERE `configkey` = \'installed_version\'');
|
$query = OC_DB::prepare('SELECT `appid`, `configvalue` FROM `*PREFIX*appconfig`'
|
||||||
$result = $query->execute();
|
. ' WHERE `configkey` = \'installed_version\'');
|
||||||
while ($row = $result->fetchRow()) {
|
$result = $query->execute();
|
||||||
$versions[$row['appid']] = $row['configvalue'];
|
while ($row = $result->fetchRow()) {
|
||||||
|
$versions[$row['appid']] = $row['configvalue'];
|
||||||
|
}
|
||||||
|
return $versions;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return array();
|
||||||
}
|
}
|
||||||
return $versions;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue