Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 68b5337

Browse files
authored
Add null checks for CanvasElement attributes (#20580)
Changes in processing compatibility info in dart:html requires these getters to be null-checked.
1 parent 38a3029 commit 68b5337

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/web_ui/lib/src/engine/html/surface_stats.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ void _debugPrintSurfaceStats(PersistedScene scene, int frameNumber) {
291291
final int pixelCount = canvasElements
292292
.cast<html.CanvasElement>()
293293
.map<int>((html.CanvasElement e) {
294-
final int pixels = e.width * e.height;
295-
canvasInfo.writeln(' - ${e.width} x ${e.height} = $pixels pixels');
294+
final int pixels = e.width! * e.height!;
295+
canvasInfo.writeln(' - ${e.width!} x ${e.height!} = $pixels pixels');
296296
return pixels;
297297
}).fold(0, (int total, int pixels) => total + pixels);
298298
final double physicalScreenWidth =

0 commit comments

Comments
 (0)