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.
This commit is contained in:
@@ -531,6 +531,7 @@ class PictureLayer extends Layer {
|
||||
|
||||
@override
|
||||
void addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) {
|
||||
assert(picture != null);
|
||||
builder.addPicture(layerOffset, picture, isComplexHint: isComplexHint, willChangeHint: willChangeHint);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user