Ignore another dead_code hint for a weak-only null check. (#63602)

This commit is contained in:
Paul Berry
2020-08-13 14:36:08 -07:00
committed by GitHub
parent 0ec50a8e63
commit 8f896c9027

View File

@@ -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');
}