Skip to content

Commit

Permalink
Ignore another dead_code hint for a weak-only null check. (flutter#63602
Browse files Browse the repository at this point in the history
)
  • Loading branch information
stereotype441 authored and mingwandroid committed Sep 6, 2020
1 parent dec4efe commit a831fd9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/flutter/lib/src/painting/image_provider.dart
Expand Up @@ -672,7 +672,10 @@ abstract class AssetBundleImageProvider extends ImageProvider<AssetBundleImageKe
PaintingBinding.instance!.imageCache!.evict(key);
rethrow;
}
if (data == null) {
// `key.bundle.load` has a non-nullable return type, but might be null when
// running with weak checking, so we need to null check it anyway (and
// ignore the warning that the null-handling logic is dead code).
if (data == null) { // ignore: dead_code
PaintingBinding.instance!.imageCache!.evict(key);
throw StateError('Unable to read data');
}
Expand Down

0 comments on commit a831fd9

Please sign in to comment.