diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index 1a24ed2138..5cc4ecc603 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -186,9 +186,10 @@ SanitizedResult Sanitize( SanitizedResult result; result.program = std::move(out.program); - result.used_array_length_from_uniform_indices = - std::move(out.data.Get() - ->used_size_indices); + if (auto* res = out.data.Get()) { + result.used_array_length_from_uniform_indices = + std::move(res->used_size_indices); + } return result; }