commit 19667f70eddd281f8acc6b539c4680c4d55ea80e
parent 52872f85a5a6f052386dc65dc49370b8daf98b46
Author: Luke Jones <luke.jones.2567@gmail.com>
Date: Tue, 21 Jul 2026 23:44:53 +0100
fix: unhanlded null coordinate value
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/pages/photos/[id].astro b/src/pages/photos/[id].astro
@@ -22,11 +22,17 @@ const { photo } = Astro.props;
const photoSourceUrl = "/photos/source/";
const photoExtension = ".jpg";
+let coordString = 'None';
+
+if (photo.coordinates) {
+ coordString = `${photo.coordinates.x}, ${photo.coordinates.y}`
+}
+
const photoPath = `${photoSourceUrl}${photo.id}${photoExtension}`;
const tableData = {
"Location": photo.location,
- "Coordinates": `${photo.coordinates.x}, ${photo.coordinates.y}`,
+ "Coordinates": coordString,
"Tags": photo.tags
}
---