From a526a364439128f870c23fe6cfd1587042ccb032 Mon Sep 17 00:00:00 2001 From: kmmiio99o Date: Fri, 24 Jul 2026 14:45:29 +0200 Subject: [PATCH] fix: Cannot read property 'tasks' of undefined --- plugins/ServerDrawer/src/patches/contentPatch.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/ServerDrawer/src/patches/contentPatch.tsx b/plugins/ServerDrawer/src/patches/contentPatch.tsx index 4ddebf7..669645c 100644 --- a/plugins/ServerDrawer/src/patches/contentPatch.tsx +++ b/plugins/ServerDrawer/src/patches/contentPatch.tsx @@ -37,9 +37,17 @@ export function patchEmpty( return false; } const orig = mod.type; + const originalComponent = orig; + mod.type = function EmptyPatch() { return null; }; + + if (originalComponent) { + Object.defineProperties(mod.type, Object.getOwnPropertyDescriptors(originalComponent)); + mod.type.displayName = name; + } + cleanups.push(() => { mod.type = orig; }); return true; }