Skip to content

Commit d505608

Browse files
author
Eduard Aksamitov
authored
fix(plugin): early proxy hook can be undefined (#1617)
1 parent 7d64995 commit d505608

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/api/src/proxy.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ export class ApiProxy<TTarget extends DevtoolsPluginApi<any> = DevtoolsPluginApi
5959
},
6060
}
6161

62-
hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
63-
if (pluginId === this.plugin.id) {
64-
this.fallbacks.setSettings(value)
65-
}
66-
})
62+
if (hook) {
63+
hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
64+
if (pluginId === this.plugin.id) {
65+
this.fallbacks.setSettings(value)
66+
}
67+
})
68+
}
6769

6870
this.proxiedOn = new Proxy({} as Hookable<Context>, {
6971
get: (_target, prop: string) => {

0 commit comments

Comments
 (0)