Bug 1829606 - [devtools] Fix "listener.onTracingToggled is not a function" exceptino when enabling the tracer. r=devtools-reviewers,nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D176347
This commit is contained in:
Alexandre Poirot 2023-04-25 13:42:31 +00:00
parent d8c705b294
commit dffb4077bf

View File

@ -327,7 +327,10 @@ function stopTracing() {
function addTracingListener(listener) {
listeners.add(listener);
if (activeTracer?.isTracing()) {
if (
activeTracer?.isTracing() &&
typeof listener.onTracingToggled == "function"
) {
listener.onTracingToggled(true);
}
}