diff --git a/packages/snaps-simulator/src/features/handlers/components/UserInterface.tsx b/packages/snaps-simulator/src/features/handlers/components/UserInterface.tsx index 9b06ed9fb1..a6c8cbdd43 100644 --- a/packages/snaps-simulator/src/features/handlers/components/UserInterface.tsx +++ b/packages/snaps-simulator/src/features/handlers/components/UserInterface.tsx @@ -20,11 +20,12 @@ export const UserInterface: FunctionComponent = () => { tab.setSelectedIndex(1); }, [tab]); + console.log(ui); + if (!ui?.id) { return null; } - console.log(ui); const { snapName, snapId, type, id } = ui; switch (type) { diff --git a/packages/snaps-simulator/src/hooks/useSnapInterface.ts b/packages/snaps-simulator/src/hooks/useSnapInterface.ts index 67dd177804..adebf5f1b2 100644 --- a/packages/snaps-simulator/src/hooks/useSnapInterface.ts +++ b/packages/snaps-simulator/src/hooks/useSnapInterface.ts @@ -13,6 +13,9 @@ export const useSnapInterface = (snapId: string, interfaceId: string) => { ); useEffect(() => { + if (!interfaceId) { + return; + } const storedInterface = snapInterfaceController?.getInterface( snapId as SnapId, interfaceId,