From bf58e08e4b5b183737c9ad43a858b642ce593f93 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Fri, 11 Oct 2024 14:59:42 -0400 Subject: [PATCH] fix(DialogCheckbox): prevent some potential issues in dialogcheckbox --- src/components/DialogCheckbox.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/DialogCheckbox.ts b/src/components/DialogCheckbox.ts index 446f467..a6e0dd5 100644 --- a/src/components/DialogCheckbox.ts +++ b/src/components/DialogCheckbox.ts @@ -20,13 +20,14 @@ export interface DialogCheckboxProps extends DialogCommonProps, FooterLegendProp // Do not access KeyDown, SetChecked, Toggle here as they are getters and accessing them outside of a render breaks them globally export const DialogCheckbox = findModuleExport(e => - e.prototype && + e?.prototype && + typeof e?.prototype == "object" && "GetPanelElementProps" in e?.prototype && "SetChecked" in e?.prototype && "Toggle" in e?.prototype && // beta || stable as of oct 2 2024 - (e?.prototype?.render?.toString().includes('="DialogCheckbox"') || ( + (e?.prototype?.render?.toString?.().includes('="DialogCheckbox"') || ( e.contextType && - e.prototype?.render?.toString().includes('fallback:') + e.prototype?.render?.toString?.().includes('fallback:') )) ) as FC;