diff --git a/MyWebsite/MyWebsite/Controllers/GalleryController.cs b/MyWebsite/MyWebsite/Controllers/GalleryController.cs index 4d171d3..7eea2c4 100644 --- a/MyWebsite/MyWebsite/Controllers/GalleryController.cs +++ b/MyWebsite/MyWebsite/Controllers/GalleryController.cs @@ -12,6 +12,8 @@ namespace MyWebsite.Controllers View(new ArtworkViewModel(Database)); public IActionResult Details(string id) => + string.IsNullOrWhiteSpace(id) ? + (IActionResult)RedirectToAction("Index") : View(new ArtworkViewModel(Database, id)); } } \ No newline at end of file