Skip to content

Commit

Permalink
Warn about invalid arguments to ColorFilter.mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-simmons committed Mar 26, 2022
1 parent ca2f95c commit 88b4d46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/web_ui/lib/src/engine/canvaskit/color_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,14 @@ class CkBlendModeColorFilter extends CkColorFilter {

@override
SkColorFilter _initRawColorFilter() {
return canvasKit.ColorFilter.MakeBlend(
SkColorFilter filter = canvasKit.ColorFilter.MakeBlend(
toSharedSkColor1(color),
toSkBlendMode(blendMode),
);
if (filter == null) {
throw ArgumentError('Invalid parameters for blend mode ColorFilter');
}
return filter;
}

@override
Expand Down

0 comments on commit 88b4d46

Please sign in to comment.