From a38582d158662747d7eeda47220b42ce4ee0452d Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Fri, 12 Aug 2022 16:49:28 -0400
Subject: Fix toaster deinit error

---
 frontend/src/toaster.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'frontend/src/toaster.tsx')

diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index b6901ed2..7980faef 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -84,9 +84,9 @@ class Toaster extends Logger {
   }
 
   deinit() {
-    unpatch(this.instanceRet, 'type');
-    delete this.node.stateNode.render;
-    this.node.stateNode.forceUpdate();
+    this.instanceRet && unpatch(this.instanceRet, 'type');
+    this.node && delete this.node.stateNode.render;
+    this.node && this.node.stateNode.forceUpdate();
   }
 }
 
-- 
cgit v1.2.3

