mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 08:33:19 +01:00
Add missing Argument null exceptions to post write handlers
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user