[Impeller] Check for a null command buffer in InlinePassContext::EndPass (flutter/engine#43485)

This could happen if the pass is immediately ended due to clear color
optimization.

Fixes https://github.com/flutter/flutter/issues/130167
This commit is contained in:
Jason Simmons
2023-07-08 07:14:57 -07:00
committed by GitHub
parent 198f0d9628
commit 0f179b102a

View File

@@ -54,10 +54,13 @@ bool InlinePassContext::EndPass() {
return true;
}
if (!command_buffer_->SubmitCommandsAsync(std::move(pass_))) {
VALIDATION_LOG << "Failed to encode and submit command buffer while ending "
"render pass.";
return false;
if (command_buffer_) {
if (!command_buffer_->SubmitCommandsAsync(std::move(pass_))) {
VALIDATION_LOG
<< "Failed to encode and submit command buffer while ending "
"render pass.";
return false;
}
}
pass_ = nullptr;