summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Controllers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-09 13:59:56 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-09 13:59:56 -0400
commit650af7ef1ac1957919ab19ec3d06af97792c54f8 (patch)
tree626ba6caf86d400616121a7520e33f5b8bbad7b4 /src/SMAPI.Web/Controllers
parentad4d065fe748b4f3f32a8bf03e9a96132e1a0c79 (diff)
downloadSMAPI-650af7ef1ac1957919ab19ec3d06af97792c54f8.tar.gz
SMAPI-650af7ef1ac1957919ab19ec3d06af97792c54f8.tar.bz2
SMAPI-650af7ef1ac1957919ab19ec3d06af97792c54f8.zip
enable nullable annotations in log parser (#837)
Diffstat (limited to 'src/SMAPI.Web/Controllers')
-rw-r--r--src/SMAPI.Web/Controllers/LogParserController.cs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SMAPI.Web/Controllers/LogParserController.cs b/src/SMAPI.Web/Controllers/LogParserController.cs
index 524cfbcc..93f2613e 100644
--- a/src/SMAPI.Web/Controllers/LogParserController.cs
+++ b/src/SMAPI.Web/Controllers/LogParserController.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Linq;
using System.Text;
@@ -47,7 +45,7 @@ namespace StardewModdingAPI.Web.Controllers
[HttpGet]
[Route("log")]
[Route("log/{id}")]
- public async Task<ActionResult> Index(string id = null, LogViewFormat format = LogViewFormat.Default, bool renew = false)
+ public async Task<ActionResult> Index(string? id = null, LogViewFormat format = LogViewFormat.Default, bool renew = false)
{
// fresh page
if (string.IsNullOrWhiteSpace(id))
@@ -89,7 +87,7 @@ namespace StardewModdingAPI.Web.Controllers
public async Task<ActionResult> PostAsync()
{
// get raw log text
- string input = this.Request.Form["input"].FirstOrDefault();
+ string? input = this.Request.Form["input"].FirstOrDefault();
if (string.IsNullOrWhiteSpace(input))
return this.View("Index", this.GetModel(null, uploadError: "The log file seems to be empty."));
@@ -111,7 +109,7 @@ namespace StardewModdingAPI.Web.Controllers
/// <param name="expiry">When the uploaded file will no longer be available.</param>
/// <param name="uploadWarning">A non-blocking warning while uploading the log.</param>
/// <param name="uploadError">An error which occurred while uploading the log.</param>
- private LogParserModel GetModel(string pasteID, DateTime? expiry = null, string uploadWarning = null, string uploadError = null)
+ private LogParserModel GetModel(string? pasteID, DateTime? expiry = null, string? uploadWarning = null, string? uploadError = null)
{
Platform? platform = this.DetectClientPlatform();