Bug 1778432 - [devtools] Guard against missing Services.profiler in Actor:_sendEvent r=nchevobbe

The Services object is replaced by a mock in the worker loader so Services.profiler might be undefined.

Differential Revision: https://phabricator.services.mozilla.com/D151211
This commit is contained in:
Julian Descottes 2022-07-07 13:43:56 +00:00
Родитель c5f7c7111f
Коммит d6eac88099
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -76,7 +76,9 @@ class Actor extends Pool {
// This can really be a hot path, even computing the marker label can
// have some performance impact.
if (Services.profiler.IsActive()) {
// Guard against missing `Services.profiler` because Services is mocked to
// an empty object in the worker loader.
if (Services.profiler?.IsActive()) {
ChromeUtils.addProfilerMarker(
"DevTools:RDP Actor",
null,