Skip to content

Commit

Permalink
Added null check
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanHojnoski committed Oct 20, 2024
1 parent 297c190 commit 688f1e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const MainContent = observer(() => {

let openBasket = false;
// Check if there is a basket in the query parameter
if (router.query.basket) {
if (router?.query.basket) {
const basketData: BasketData = JSON.parse(router.query.basket.toString()) as BasketData;
void router.replace('/');
const newBasket = allBasketsState.addBasket(basketData.term);
Expand Down

0 comments on commit 688f1e9

Please sign in to comment.