From acf48b5a057df0f751e61627e5a62e7e3c66eaaa Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 11 Jun 2024 09:48:03 -0700 Subject: [PATCH] [engine] null check texture registry in OnPlatformViewMarkTextureFrameAvailable. (flutter/engine#53334) From the issue, it looks like an NPE in this closure, we're not sure what else it could be besides the weak ptr - which could be null. Fixes https://github.com/flutter/flutter/issues/149895 --- engine/src/flutter/shell/common/shell.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/src/flutter/shell/common/shell.cc b/engine/src/flutter/shell/common/shell.cc index 7b5d2085343..5f6076b5a7f 100644 --- a/engine/src/flutter/shell/common/shell.cc +++ b/engine/src/flutter/shell/common/shell.cc @@ -1186,6 +1186,9 @@ void Shell::OnPlatformViewMarkTextureFrameAvailable(int64_t texture_id) { // Tell the rasterizer that one of its textures has a new frame available. task_runners_.GetRasterTaskRunner()->PostTask( [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { + if (!rasterizer) { + return; + } auto registry = rasterizer->GetTextureRegistry(); if (!registry) {