Add missing Argument null exceptions to post write handlers

This commit is contained in:
Jordan Brown
2018-11-02 15:14:08 -04:00
parent ed03008a72
commit bf77bc261f
2 changed files with 12 additions and 2 deletions
@@ -1,5 +1,6 @@
using Mono.Unix;
using Mono.Unix.Native;
using System;
namespace Tgstation.Server.Host.IO
{
@@ -11,6 +12,9 @@ namespace Tgstation.Server.Host.IO
/// <inheritdoc />
public void HandleWrite(string filePath)
{
if (filePath == null)
throw new ArgumentNullException(nameof(filePath));
//set executable bit every time, don't want people calling me when their uploaded "sl" binary doesn't work
if (Syscall.stat(filePath, out var stat) != 0)
throw new UnixIOException(Stdlib.GetLastError());
@@ -1,4 +1,6 @@
namespace Tgstation.Server.Host.IO
using System;
namespace Tgstation.Server.Host.IO
{
/// <summary>
/// <see cref="IPostWriteHandler"/> for Windows systems
@@ -6,6 +8,10 @@
sealed class WindowsPostWriteHandler : IPostWriteHandler
{
/// <inheritdoc />
public void HandleWrite(string filePath) { }
public void HandleWrite(string filePath)
{
if (filePath == null)
throw new ArgumentNullException(nameof(filePath));
}
}
}