summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-03-05 13:56:53 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-03-05 13:56:53 -0500
commit387bac588d7e174f2f8fbdb0ccedf02181aa0dcb (patch)
tree65ba0e64957a2985352f0a433459f442a2d0c43c
parent77928015f2a865d69432b160c326cabf2e7a9bf6 (diff)
downloadpo-387bac588d7e174f2f8fbdb0ccedf02181aa0dcb.tar.gz
po-387bac588d7e174f2f8fbdb0ccedf02181aa0dcb.tar.bz2
po-387bac588d7e174f2f8fbdb0ccedf02181aa0dcb.zip
[fix] Silence a warning when album list is empty
-rw-r--r--src/include/common.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/include/common.php b/src/include/common.php
index 46796c5..718bfd3 100644
--- a/src/include/common.php
+++ b/src/include/common.php
@@ -1453,8 +1453,13 @@ function display_albums($database, $album_id, $owner_user_id, $event = FALSE, $d
and can_access_album(album.identifier, $po_user[id], '{".$passwords."}')
order by $sql_query_order_by_string");
- $all_albums = pg_fetch_all($all_albums);
- $num_of_albums = sizeof($all_albums);
+ if (pg_num_rows($all_albums) > 0) {
+ $all_albums = pg_fetch_all($all_albums);
+ $num_of_albums = sizeof($all_albums);
+ } else {
+ $all_albums = array();
+ $num_of_albums = 0;
+ }
$display_extra = (($po_user['id'] == $owner_user_id) || ($po_user['type'] == PO_USER_TYPE_ADMIN));