diff --git a/src/dawn_native/d3d12/AdapterD3D12.cpp b/src/dawn_native/d3d12/AdapterD3D12.cpp index 7d3d2e1b4b..b43c1dae08 100644 --- a/src/dawn_native/d3d12/AdapterD3D12.cpp +++ b/src/dawn_native/d3d12/AdapterD3D12.cpp @@ -193,6 +193,11 @@ namespace dawn_native { namespace d3d12 { return; } + // The device may not exist if this adapter failed to initialize. + if (mD3d12Device == nullptr) { + return; + } + // If the debug layer is not installed, return immediately to avoid crashing the process. ComPtr infoQueue; if (FAILED(mD3d12Device.As(&infoQueue))) {