- tweak: error cleanup

This commit is contained in:
2025-01-19 22:52:29 +03:00
parent 46d17b98b2
commit 19de47bacf
9 changed files with 29 additions and 71 deletions

View File

@@ -1,4 +1,5 @@
using Robust.LoaderApi;
using System.Diagnostics.CodeAnalysis;
using Robust.LoaderApi;
namespace Nebula.Shared.FileApis;
@@ -11,7 +12,7 @@ public class AssemblyApi : IFileApi
_root = root;
}
public bool TryOpen(string path, out Stream? stream)
public bool TryOpen(string path,[NotNullWhen(true)] out Stream? stream)
{
return _root.TryOpen(path, out stream);
}

View File

@@ -1,4 +1,5 @@
using Nebula.Shared.FileApis.Interfaces;
using System.Diagnostics.CodeAnalysis;
using Nebula.Shared.FileApis.Interfaces;
namespace Nebula.Shared.FileApis;
@@ -11,7 +12,7 @@ public sealed class FileApi : IReadWriteFileApi
RootPath = rootPath;
}
public bool TryOpen(string path, out Stream? stream)
public bool TryOpen(string path,[NotNullWhen(true)] out Stream? stream)
{
var fullPath = Path.Join(RootPath, path);
if (File.Exists(fullPath))

View File

@@ -1,4 +1,5 @@
using Nebula.Shared.Models;
using System.Diagnostics.CodeAnalysis;
using Nebula.Shared.Models;
using Robust.LoaderApi;
namespace Nebula.Shared.FileApis;
@@ -15,7 +16,7 @@ public class HashApi : IFileApi
foreach (var item in manifest) Manifest.TryAdd(item.Path, item);
}
public bool TryOpen(string path, out Stream? stream)
public bool TryOpen(string path,[NotNullWhen(true)] out Stream? stream)
{
if (path[0] == '/') path = path.Substring(1);