summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2016-03-28 18:10:50 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-03-28 18:28:36 (GMT)
commit54eaebe79dc9abd86a4c036dfd41c41d458f4605 (patch)
treef4ffe0299be75f9623a3ea809e6c50f9832d076f
parent346338b5dc3c84b80969376bc87e886f4ef880a8 (diff)
downloadxamarin-forms-54eaebe79dc9abd86a4c036dfd41c41d458f4605.zip
xamarin-forms-54eaebe79dc9abd86a4c036dfd41c41d458f4605.tar.gz
xamarin-forms-54eaebe79dc9abd86a4c036dfd41c41d458f4605.tar.bz2
[iOS,Android,Win] Make sure we only cache images that return a successful status code
-rw-r--r--Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs b/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs
index dcda2c2..614a097 100644
--- a/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs
+++ b/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs
@@ -118,7 +118,7 @@ namespace Xamarin.Forms.Platform.WinRT
using (var client = new HttpClient())
{
HttpResponseMessage streamResponse = await client.GetAsync(uri.AbsoluteUri).ConfigureAwait(false);
- return await streamResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
+ return streamResponse.IsSuccessStatusCode ? await streamResponse.Content.ReadAsStreamAsync().ConfigureAwait(false) : null;
}
}