From b5b1cbebde3d49c5ac96ceb8122db3cb33cfafd6 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 26 Jul 2018 18:23:18 -0700 Subject: [PATCH] handle case where image is null as well (#19797) --- packages/flutter/lib/src/painting/image_cache.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/painting/image_cache.dart b/packages/flutter/lib/src/painting/image_cache.dart index 771c9c53d84..edfd8e7ce45 100644 --- a/packages/flutter/lib/src/painting/image_cache.dart +++ b/packages/flutter/lib/src/painting/image_cache.dart @@ -143,7 +143,7 @@ class ImageCache { result = loader(); void listener(ImageInfo info, bool syncCall) { // 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); // 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