summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/lib/stats.inc.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/lib/stats.inc.php b/web/lib/stats.inc.php
index 80619fe1..f5692f96 100644
--- a/web/lib/stats.inc.php
+++ b/web/lib/stats.inc.php
@@ -19,10 +19,12 @@ function updates_table() {
$result = $dbh->query($q);
$newest_packages = new ArrayObject();
- while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
- $newest_packages->append($row);
+ if ($result) {
+ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
+ $newest_packages->append($row);
+ }
+ set_cache_value($key, $newest_packages);
}
- set_cache_value($key, $newest_packages);
}
include('stats/updates_table.php');
}