Unverified Commit 5587ca17 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Add assert in PictureLayer.addToScene() (#61655)

SceneBuilder.addPicture() is implemented in C++, and if `picture`
is null, it will seg-fault. This catches the problem before that
happens.
parent 7ea710c5
...@@ -531,6 +531,7 @@ class PictureLayer extends Layer { ...@@ -531,6 +531,7 @@ class PictureLayer extends Layer {
@override @override
void addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) { void addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) {
assert(picture != null);
builder.addPicture(layerOffset, picture, isComplexHint: isComplexHint, willChangeHint: willChangeHint); builder.addPicture(layerOffset, picture, isComplexHint: isComplexHint, willChangeHint: willChangeHint);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment