diff --git a/dom/webgpu/Device.cpp b/dom/webgpu/Device.cpp index fb5521e4b3eb..d87b1990a594 100644 --- a/dom/webgpu/Device.cpp +++ b/dom/webgpu/Device.cpp @@ -79,7 +79,8 @@ void Device::Cleanup() { mBridge->UnregisterDevice(mId); } - if (mLostPromise) { + // Cycle collection may have disconnected the promise object. + if (mLostPromise && mLostPromise->PromiseObj() != nullptr) { auto info = MakeRefPtr(GetParentObject(), dom::GPUDeviceLostReason::Destroyed, u"Device destroyed"_ns);