From aad173830c142c71cb9dd1baf559a678f20cbbbf Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Tue, 9 Feb 2021 08:07:40 +1100 Subject: [PATCH] Added check for name in unhandled error --- src/contexts/DatabaseContext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contexts/DatabaseContext.js b/src/contexts/DatabaseContext.js index 323b49a..d0a18be 100644 --- a/src/contexts/DatabaseContext.js +++ b/src/contexts/DatabaseContext.js @@ -40,7 +40,7 @@ export function DatabaseProvider({ children }) { }; function handleDatabaseError(event) { - if (event.reason.name === "QuotaExceededError") { + if (event.reason?.name === "QuotaExceededError") { event.preventDefault(); setDatabaseError({ name: event.reason.name,