Ensure that source is not null before accessing it
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Mon, 16 Jan 2017 13:07:48 +0000 (14:07 +0100)
committerKangho Hur <kangho.hur@samsung.com>
Mon, 10 Jul 2017 02:11:17 +0000 (11:11 +0900)
Change-Id: Iccc85ecbf24612548b9827f0cdcb666cb59a6a6f
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
Xamarin.Forms.Platform.Tizen/Native/Image.cs

index 5b64c43..ceae4e5 100755 (executable)
@@ -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);
                        }