diff options
author | Pawel Andruszkiewicz <p.andruszkie@samsung.com> | 2017-01-16 14:07:48 +0100 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-04-24 13:36:49 +0900 |
commit | dfcb56ff7bfde05b72d67675c0136825ad99ffad (patch) | |
tree | b22fde7e6762e556be0db6ce2ee65f6bc96b965a | |
parent | cf37b95b3f03b77ed05fa86803c82d8a35c60ab4 (diff) | |
download | xamarin-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-x | Xamarin.Forms.Platform.Tizen/Native/Image.cs | 5 |
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); } |