glidex
glidex copied to clipboard
Allow UriImageSource.Uri to be null
Native Xamarin.Forms allows UriImageSource.Uri to be null - it behaves same as when ImageSource is null. With Glidex.Forms, however, it fails in GlideExtensions.LoadViaGlide method.
Can you share an example code snippet that fails?
Maybe you could add a page to this app? https://github.com/jonathanpeppers/glidex/tree/master/glidex.forms.sample/Forms
Thanks!
Native Xamarin.Forms allows UriImageSource.Uri to be null - it behaves same as when ImageSource is null. With Glidex.Forms, however, it fails in GlideExtensions.LoadViaGlide method.
Hi Dreamescaper. I just replaced the code in GlideExtensions.cs file:
case UriImageSource uriSource:
{
if(uriSource is null || uriSource.Uri is null || string.IsNullOrEmpty(uriSource.Uri.OriginalString))
{
Clear (request, imageView);
return;
}
builder = HandleUriImageSource (request, uriSource);
}
break;
No more Null Reference Exception. Regards
@visualbruno if you fixed something, would you consider sending a pull request explaining the fix? Thanks!