From d5d757fb60d6d5d01f2bbdc4aabcdec1444e8967 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 13 Jan 2015 17:11:15 +0100 Subject: [PATCH] CustomImageView: Fixed crash when the image URL is not valid --- matrixConsole/View/CustomImageView.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/matrixConsole/View/CustomImageView.m b/matrixConsole/View/CustomImageView.m index b62ecea2c..ca8ed808a 100644 --- a/matrixConsole/View/CustomImageView.m +++ b/matrixConsole/View/CustomImageView.m @@ -473,6 +473,13 @@ } - (void)updateProgressUI:(NSDictionary*)downloadStatsDict { + + // Sanity check: updateProgressUI may be called while there is no stats available + // This happens when the download failed at the very beginning. + if (nil == downloadStatsDict) { + return; + } + NSNumber* progressNumber = [downloadStatsDict valueForKey:kMediaLoaderProgressRateKey]; if (progressNumber) {