Skip to content

Commit

Permalink
Throw InvalidOperationException if AppLinkEntry.Thumbnail source is i…
Browse files Browse the repository at this point in the history
…nvalid (xamarin#299)
  • Loading branch information
jimmgarrido authored and jh5.cho committed Sep 1, 2016
1 parent 3ca3c6d commit 6b7a1df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Xamarin.Forms.Platform.iOS/iOSAppLinks.cs
Expand Up @@ -126,13 +126,17 @@ static async Task<CSSearchableItemAttributeSet> GetAttributeSet(IAppLinkEntry de
try
{
uiimage = await handler.LoadImageAsync(source);

if (uiimage == null)
throw new InvalidOperationException("AppLinkEntry Thumbnail must be set to a valid source");

searchableAttributeSet.ThumbnailData = uiimage.AsPNG();
uiimage.Dispose();
}
catch (OperationCanceledException)
{
uiimage = null;
}
searchableAttributeSet.ThumbnailData = uiimage.AsPNG();
uiimage.Dispose();
}

return searchableAttributeSet;
Expand Down

0 comments on commit 6b7a1df

Please sign in to comment.