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-04-24 13:36:49 +0900
commitdfcb56ff7bfde05b72d67675c0136825ad99ffad (patch)
treeb22fde7e6762e556be0db6ce2ee65f6bc96b965a
parentcf37b95b3f03b77ed05fa86803c82d8a35c60ab4 (diff)
downloadxamarin-forms-dfcb56ff7bfde05b72d67675c0136825ad99ffad.tar.gz
xamarin-forms-dfcb56ff7bfde05b72d67675c0136825ad99ffad.tar.bz2
xamarin-forms-dfcb56ff7bfde05b72d67675c0136825ad99ffad.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);
}