From b97a8d0d56edaf122c72b556e04c2956aea161d1 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Sat, 1 Aug 2026 06:12:13 +0530 Subject: [PATCH] fix: code quality and safety improvements --- js/recommendations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/recommendations.js b/js/recommendations.js index ad32cfe..d00caa9 100644 --- a/js/recommendations.js +++ b/js/recommendations.js @@ -1,7 +1,7 @@ /// ===== SMART RECOMMENDATION ENGINE ===== // Load cart from localStorage -let cart = JSON.parse(localStorage.getItem("chaatCart")) || []; +let cart = (() => { try { return JSON.parse(localStorage.getItem("chaatCart")) } catch { return null } })() || []; // ===== FOOD PAIRINGS =====