diff --git a/src/routes/_layout.svelte b/src/routes/_layout.svelte
index 2623629..4e66a19 100644
--- a/src/routes/_layout.svelte
+++ b/src/routes/_layout.svelte
@@ -99,7 +99,9 @@
// Add last updated date to each location
data.locations.data.forEach(location => {
const latestPhoto = latestPhotos.find(photo => photo.location.id === location.id)
- location.last_updated = latestPhoto.created_on
+ if (latestPhoto) {
+ location.last_updated = latestPhoto.created_on
+ }
})
// Set data into store
@@ -171,7 +173,7 @@
{/each}
-
+