From fa2ea394058eae95c80a1015fa32067afafc0133 Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Wed, 15 Mar 2023 04:01:44 -0700 Subject: [PATCH] Fix bad types and npe Summary: Framework events was added recently so no garentueed to always be on all clients. Should fix T145084769 Reviewed By: mweststrate Differential Revision: D44064430 fbshipit-source-id: 5dab14a7de5815a25cf8fe7bfa485a6a57d60071 --- desktop/plugins/public/ui-debugger/index.tsx | 2 +- desktop/plugins/public/ui-debugger/types.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/plugins/public/ui-debugger/index.tsx b/desktop/plugins/public/ui-debugger/index.tsx index 81954da5b..181083ffa 100644 --- a/desktop/plugins/public/ui-debugger/index.tsx +++ b/desktop/plugins/public/ui-debugger/index.tsx @@ -56,7 +56,7 @@ export function plugin(client: PluginClient) { client.onMessage('init', (event) => { rootId.set(event.rootId); uiState.frameworkEventMonitoring.update((draft) => { - event.frameworkEventMetadata.forEach((frameworkEventMeta) => { + event.frameworkEventMetadata?.forEach((frameworkEventMeta) => { draft.set(frameworkEventMeta.type, false); }); }); diff --git a/desktop/plugins/public/ui-debugger/types.tsx b/desktop/plugins/public/ui-debugger/types.tsx index 3e2740b74..8ae301b48 100644 --- a/desktop/plugins/public/ui-debugger/types.tsx +++ b/desktop/plugins/public/ui-debugger/types.tsx @@ -44,7 +44,7 @@ export type FrameworkEvent = { export type InitEvent = { rootId: Id; - frameworkEventMetadata: FrameworkEventMetadata[]; + frameworkEventMetadata?: FrameworkEventMetadata[]; }; export type PerfStatsEvent = {