Fix a 500 error on invalid configuration delete request

This commit is contained in:
Jordan Brown
2020-08-10 11:43:14 -04:00
parent 4301f90589
commit 246b8a8c50
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
@@ -291,6 +291,9 @@ namespace Tgstation.Server.Host.Controllers
if (directory == null)
throw new ArgumentNullException(nameof(directory));
if (directory.Path == null)
return BadRequest(new ErrorMessage(ErrorCode.ModelValidationFailure));
if (ForbidDueToModeConflicts(directory.Path, out var systemIdentity))
return Forbid();