Skip to content

Commit

Permalink
Check for a deleted snapshot delegate in ConvertImageToRaster (flutte…
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-simmons authored Jun 2, 2022
1 parent 6afacf9 commit 172a120
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ui/painting/image_encoding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ void ConvertImageToRaster(
raster_task_runner->PostTask([image, encode_task = std::move(encode_task),
resource_context, snapshot_delegate,
io_task_runner, is_gpu_disabled_sync_switch]() {
if (!snapshot_delegate) {
io_task_runner->PostTask(
[encode_task = std::move(encode_task)]() mutable {
encode_task(nullptr);
});
return;
}

sk_sp<SkImage> raster_image =
snapshot_delegate->ConvertToRasterImage(image);

Expand Down

0 comments on commit 172a120

Please sign in to comment.