diff --git a/src/routes/watchlist/stocks/+page.svelte b/src/routes/watchlist/stocks/+page.svelte index b60f7de0..3095e8b8 100644 --- a/src/routes/watchlist/stocks/+page.svelte +++ b/src/routes/watchlist/stocks/+page.svelte @@ -289,7 +289,7 @@ async function handleAddTicker(event, ticker) { // Ensure inputValue is reset inputValue = ''; // Check if the ticker is already in the watchList; if not, add it -if (!watchList.some(item => item.symbol === ticker)) { +if (!watchList?.some(item => item?.symbol === ticker)) { } else { toast.error(`This symbol is already in your watchlist`, { style: 'border-radius: 10px; background: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);', @@ -557,6 +557,7 @@ function search() {