summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>2017-01-16 14:07:48 +0100
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:19:00 +0900
commit4df442dd9c9de9af29c96ffd5438e15e28336453 (patch)
treed40d0bd902a1cc4d7a5e54927b6ca07e42b5bed8
parent350b02f25fe9700910d99f511c42a04925f91660 (diff)
downloadxamarin-forms-4df442dd9c9de9af29c96ffd5438e15e28336453.tar.gz
xamarin-forms-4df442dd9c9de9af29c96ffd5438e15e28336453.tar.bz2
xamarin-forms-4df442dd9c9de9af29c96ffd5438e15e28336453.zip
Ensure that source is not null before accessing it
Change-Id: Iccc85ecbf24612548b9827f0cdcb666cb59a6a6f Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
-rwxr-xr-xXamarin.Forms.Platform.Tizen/Native/Image.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Image.cs b/Xamarin.Forms.Platform.Tizen/Native/Image.cs
index 5b64c435..ceae4e5f 100755
--- a/Xamarin.Forms.Platform.Tizen/Native/Image.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/Image.cs
@@ -72,11 +72,10 @@ namespace Xamarin.Forms.Platform.Tizen.Native
/// <param name="source">Image source specifying from where the image data has to be loaded.</param>
public async Task<bool> LoadFromImageSourceAsync(ImageSource source)
{
- IImageSourceHandler handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType());
-
_imageLoadCompleted = false;
+ IImageSourceHandler handler;
- if (source != null && handler != null)
+ if (source != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
{
_imageLoadCompleted = await handler.LoadImageAsync(this, source);
}