diff --git a/src/components/ListItem.jsx b/src/components/ListItem.jsx index ebf7d11..1b7334e 100644 --- a/src/components/ListItem.jsx +++ b/src/components/ListItem.jsx @@ -13,7 +13,7 @@ export function ListItem({ name, listPath, id, isChecked, datePurchased }) { useEffect(() => { const today = new Date().getTime(); - const datePurchasedInMillis = datePurchased.toMillis(); + const datePurchasedInMillis = datePurchased?.toMillis(); if (isChecked && today - datePurchasedInMillis >= ONE_DAY_IN_MILLISECONDS) { updateItem(listPath, id, !isChecked);