Skip to content

Commit

Permalink
[engine] null check texture registry in OnPlatformViewMarkTextureFram…
Browse files Browse the repository at this point in the history
…eAvailable. (#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 flutter/flutter#149895
  • Loading branch information
jonahwilliams authored Jun 11, 2024
1 parent f5b9f70 commit e0af244
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shell/common/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e0af244

Please sign in to comment.