From 0f179b102a687d9177c39c78bbd05f9e1202c965 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Sat, 8 Jul 2023 07:14:57 -0700 Subject: [PATCH] [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 --- .../flutter/impeller/entity/inline_pass_context.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/impeller/entity/inline_pass_context.cc b/engine/src/flutter/impeller/entity/inline_pass_context.cc index b04bf025c7..4253e75987 100644 --- a/engine/src/flutter/impeller/entity/inline_pass_context.cc +++ b/engine/src/flutter/impeller/entity/inline_pass_context.cc @@ -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;