Skip to content

Commit 7d31869

Browse files
committed
fix: add 500 error if no response
1 parent 840d379 commit 7d31869

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pages/api/active.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ const locations = async (req: NextApiRequest, res: NextApiResponse) => {
169169
}
170170
}
171171

172+
if (!response) {
173+
return res.status(500).json({ error: "Could not get locations" });
174+
}
172175
res.status(200).json(response);
173176
};
174177

0 commit comments

Comments
 (0)