diff --git a/Views/HomePage.xaml.cs b/Views/HomePage.xaml.cs index b74cfd2..3b46cb2 100644 --- a/Views/HomePage.xaml.cs +++ b/Views/HomePage.xaml.cs @@ -20,8 +20,13 @@ public partial class HomePage : ContentPage { layout.Children.Add(new RecipeView(info, () => { - Recipe recipe = service.GetRecipe(info); - Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, 1)); + Recipe? recipe = service.GetRecipe(info); + if (recipe != null) + Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, 1)); + else + { + notifier.Error("Could not find recipe"); + } })); }