From 66e6cea02087511a3eda5b3f92870141de8184cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20P?= <nicolo.paraciani@cnr.it>
Date: Fri, 6 Dec 2024 15:31:05 +0100
Subject: [PATCH] Fix null image author

---
 webgis/js/ui.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/webgis/js/ui.js b/webgis/js/ui.js
index bbe438e..5da4906 100644
--- a/webgis/js/ui.js
+++ b/webgis/js/ui.js
@@ -243,8 +243,9 @@ UI.imageGallery = function (galleryId, images, video = false) {
 	if (element) {
 		let gallery = [];
 		for (let img of images) {
+			let author = img.author ? ` (${img.author})` : '';
 			let mediaObj = {
-				description: `${img.caption} (${img.author})`
+				description: img.caption + author
 			};
 
 			if (video) {