[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
This commit is contained in:
Jonah Williams 2024-06-11 09:48:03 -07:00 committed by GitHub
parent 8d68c0be3f
commit acf48b5a05

View File

@ -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) {