From 032f849092c8518bc418810346ebf682238ed55c Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Mon, 6 May 2024 18:06:31 -0700
Subject: Protect against missing element

---
 src/App.web.tsx | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

(limited to 'src/App.web.tsx')

diff --git a/src/App.web.tsx b/src/App.web.tsx
index 39790a448..9c2b34a78 100644
--- a/src/App.web.tsx
+++ b/src/App.web.tsx
@@ -110,15 +110,14 @@ function InnerApp() {
 
 function App() {
   const [isReady, setReady] = useState(false)
-  
+
   React.useEffect(() => {
     initPersistedState().then(() => {
       setReady(true)
-      
-      const preloadElement = document.getElementById('preload');
-      preloadElement.remove();
+
+      const preloadElement = document.getElementById('preload')
+      preloadElement?.remove()
     })
-    
   }, [])
 
   if (!isReady) {
-- 
cgit 1.4.1

