From bcee865e1d92a9ff646d92f79be7b6912db846e7 Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Sat, 9 May 2020 18:12:57 +0200 Subject: [PATCH] Chacking that picture and gallery ids are not null before trying to find them (#2). --- wp-gpx-maps_utils_nggallery.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-gpx-maps_utils_nggallery.php b/wp-gpx-maps_utils_nggallery.php index 5b88078..014915e 100644 --- a/wp-gpx-maps_utils_nggallery.php +++ b/wp-gpx-maps_utils_nggallery.php @@ -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();