Skip to content

Commit

Permalink
Merge pull request #203 from inkerton/main
Browse files Browse the repository at this point in the history
Runtime error solved
  • Loading branch information
TenzDelek authored Oct 31, 2024
2 parents 717004e + 0033345 commit faf70bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/guestbook/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ function Guestbook() {
try {
const res = await fetch("/api/guestbook/entries");
const data = await res.json();
setEntries(data);
// setEntries(data);
setEntries(Array.isArray(data) ? data : []);

} catch (error) {
console.error("Failed to fetch guestbook entries", error);
} finally {
Expand Down

0 comments on commit faf70bf

Please sign in to comment.