From 3b9741744209d5214ced239f00081002ca2e5bdc Mon Sep 17 00:00:00 2001 From: Clay Nicholson <82461712+claynicholson@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:05:07 -0400 Subject: [PATCH] Bin won't error (#1677) --- pages/bin/gallery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/bin/gallery.js b/pages/bin/gallery.js index 4359d096..aeabcc38 100644 --- a/pages/bin/gallery.js +++ b/pages/bin/gallery.js @@ -14,14 +14,14 @@ export async function getStaticProps() { const res = await fetch(`${host}/api/bin/gallery/posts/`); const posts = await res.json(); - const filteredPosts = await posts.filter(post => post.status === 'Accepted' && post.parts && !post.hide); + const filteredPosts = Array.isArray(posts) ? posts.filter(post => post.status === 'Accepted' && post.parts && !post.hide) : []; //Tags const resTag = await fetch(`${host}/api/bin/gallery/tags/`); const tags = await resTag.json(); - const filteredTags = tags.filter(tag => !tag.hide); + const filteredTags = Array.isArray(tags) ? tags.filter(tag => !tag.hide) : []; return { props: { posts: filteredPosts, tags: filteredTags