Chacking that picture and gallery ids are not null before trying to find them (#2).

This commit is contained in:
Eric van der Vlist 2020-05-09 18:12:57 +02:00
parent de3b4f2593
commit bcee865e1d
1 changed files with 4 additions and 0 deletions

View File

@ -28,10 +28,14 @@ function getNGGalleryImages( $ngGalleries, $ngImages, $dt, $lat, $lon, $dtoffset
try {
$pictures = array();
foreach ( $galids as $g ) {
if ($g != null ) {
$pictures = array_merge( $pictures, nggdb::get_gallery( $g ) );
}
}
foreach ( $imgids as $i ) {
if ($i != null) {
array_push( $pictures, nggdb::find_image( $i ) );
}
}
foreach ( $pictures as $p ) {
$item = array();