Add null checks for CanvasElement attributes (flutter/engine#20580)

Changes in processing compatibility info in dart:html requires
these getters to be null-checked.
This commit is contained in:
Srujan Gaddam
2020-08-20 15:50:01 -07:00
committed by GitHub
parent 2021143b42
commit d9c5ff0499

View File

@@ -291,8 +291,8 @@ void _debugPrintSurfaceStats(PersistedScene scene, int frameNumber) {
final int pixelCount = canvasElements
.cast<html.CanvasElement>()
.map<int>((html.CanvasElement e) {
final int pixels = e.width * e.height;
canvasInfo.writeln(' - ${e.width} x ${e.height} = $pixels pixels');
final int pixels = e.width! * e.height!;
canvasInfo.writeln(' - ${e.width!} x ${e.height!} = $pixels pixels');
return pixels;
}).fold(0, (int total, int pixels) => total + pixels);
final double physicalScreenWidth =