From 414e90730b83aabdf46f3b8039a2a7c85f20c962 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Thu, 25 Feb 2021 09:16:35 -0800 Subject: [PATCH] Fixed possible null pointer crash on startup Summary: Fix for https://github.com/facebook/flipper/issues/1964 Changelog: fixed possible crash on startup after updating from a previous Flipper version to 0.77.0 Reviewed By: mweststrate Differential Revision: D26664846 fbshipit-source-id: 6f9fabeaee8cfe1fa0df11bb57e27d659378a835 --- desktop/app/src/reducers/connections.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/app/src/reducers/connections.tsx b/desktop/app/src/reducers/connections.tsx index 7f06cae78..ceadcedd4 100644 --- a/desktop/app/src/reducers/connections.tsx +++ b/desktop/app/src/reducers/connections.tsx @@ -644,13 +644,13 @@ export function isPluginEnabled( app: string | null, pluginId: string, ): boolean { - if (enabledDevicePlugins.has(pluginId)) { + if (enabledDevicePlugins?.has(pluginId)) { return true; } - if (!app) { + if (!app || !enabledPlugins) { return false; } const appInfo = deconstructClientId(app); - const starred = enabledPlugins[appInfo.app]; - return starred && starred.indexOf(pluginId) > -1; + const enabledAppPlugins = enabledPlugins[appInfo.app]; + return enabledAppPlugins && enabledAppPlugins.indexOf(pluginId) > -1; }