From 54398fbe2933566ce3872e29aabc22766526ba5f Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Mon, 28 Jan 2019 19:58:41 -0800 Subject: [PATCH] Fixed untitled paste title --- Teknik/Areas/Paste/Controllers/PasteController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Teknik/Areas/Paste/Controllers/PasteController.cs b/Teknik/Areas/Paste/Controllers/PasteController.cs index 98b0615..4d98b1e 100644 --- a/Teknik/Areas/Paste/Controllers/PasteController.cs +++ b/Teknik/Areas/Paste/Controllers/PasteController.cs @@ -45,7 +45,7 @@ namespace Teknik.Areas.Paste.Controllers Models.Paste paste = _dbContext.Pastes.Where(p => p.Url == url).FirstOrDefault(); if (paste != null) { - ViewBag.Title = paste.Title + " | Pastebin"; + ViewBag.Title = (string.IsNullOrEmpty(paste.Title)) ? "Untitled Paste" : paste.Title + " | Pastebin"; ViewBag.Description = "Paste your code or text easily and securely. Set an expiration, set a password, or leave it open for the world to see."; // Increment Views paste.Views += 1;