From 492b742f010014daa8d65eb3b9c5b58dcd0df476 Mon Sep 17 00:00:00 2001 From: Jason Laster Date: Mon, 9 Oct 2017 10:22:20 -0400 Subject: [PATCH] Protect Worker and Browser Content Toolboxes --- src/client/firefox.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/firefox.js b/src/client/firefox.js index 7d5581d635..3a75901634 100644 --- a/src/client/firefox.js +++ b/src/client/firefox.js @@ -35,9 +35,13 @@ export async function onConnect(connection: any, actions: Object): Object { wasmBinarySource: supportsWasm }); - threadClient._parent - .listWorkers() - .then(workers => actions.setWorkers(workers)); + // NOTE: The Worker and Browser Content toolboxes do not have a parent + // with a listWorkers function + if (threadClient._parent && threadClient._parent.listWorkers) { + threadClient._parent + .listWorkers() + .then(workers => actions.setWorkers(workers)); + } // In Firefox, we need to initially request all of the sources. This // usually fires off individual `newSource` notifications as the