Unverified Commit b5b1cbeb authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

handle case where image is null as well (#19797)

parent e6fa45d6
...@@ -143,7 +143,7 @@ class ImageCache { ...@@ -143,7 +143,7 @@ class ImageCache {
result = loader(); result = loader();
void listener(ImageInfo info, bool syncCall) { void listener(ImageInfo info, bool syncCall) {
// Images that fail to load don't contribute to cache size. // Images that fail to load don't contribute to cache size.
final int imageSize = info.image == null ? 0 : info.image.height * info.image.width * 4; final int imageSize = info?.image == null ? 0 : info.image.height * info.image.width * 4;
final _CachedImage image = new _CachedImage(result, imageSize); final _CachedImage image = new _CachedImage(result, imageSize);
// If the image is bigger than the maximum cache size, and the cache size // If the image is bigger than the maximum cache size, and the cache size
// is not zero, then increase the cache size to the size of the image plus // is not zero, then increase the cache size to the size of the image plus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment