diff --git a/Robust.Server/ServerStatus/StatusHost.cs b/Robust.Server/ServerStatus/StatusHost.cs index 00abdbc24..09cc0d56f 100644 --- a/Robust.Server/ServerStatus/StatusHost.cs +++ b/Robust.Server/ServerStatus/StatusHost.cs @@ -152,21 +152,21 @@ namespace Robust.Server.ServerStatus private void RegisterCVars() { - try + var path = PathHelpers.ExecutableRelativeFile("build.json"); + if (!File.Exists(path)) { - var buildInfo = File.ReadAllText(PathHelpers.ExecutableRelativeFile("build.json")); - var info = JsonConvert.DeserializeObject(buildInfo); + return; + } - // Don't replace cvars with contents of build.json if overriden by --cvar or such. - SetCVarIfUnmodified(CVars.BuildEngineVersion, info.EngineVersion); - SetCVarIfUnmodified(CVars.BuildForkId, info.ForkId); - SetCVarIfUnmodified(CVars.BuildVersion, info.Version); - SetCVarIfUnmodified(CVars.BuildDownloadUrl, info.Download ?? ""); - SetCVarIfUnmodified(CVars.BuildHash, info.Hash ?? ""); - } - catch (FileNotFoundException) - { - } + var buildInfo = File.ReadAllText(path); + var info = JsonConvert.DeserializeObject(buildInfo); + + // Don't replace cvars with contents of build.json if overriden by --cvar or such. + SetCVarIfUnmodified(CVars.BuildEngineVersion, info.EngineVersion); + SetCVarIfUnmodified(CVars.BuildForkId, info.ForkId); + SetCVarIfUnmodified(CVars.BuildVersion, info.Version); + SetCVarIfUnmodified(CVars.BuildDownloadUrl, info.Download ?? ""); + SetCVarIfUnmodified(CVars.BuildHash, info.Hash ?? ""); void SetCVarIfUnmodified(CVarDef cvar, string val) { diff --git a/Robust.Shared/ContentPack/AssemblyTypeChecker.cs b/Robust.Shared/ContentPack/AssemblyTypeChecker.cs index 985e09ff4..041159098 100644 --- a/Robust.Shared/ContentPack/AssemblyTypeChecker.cs +++ b/Robust.Shared/ContentPack/AssemblyTypeChecker.cs @@ -767,14 +767,14 @@ namespace Robust.Shared.ContentPack var dllName = $"{simpleName}.dll"; foreach (var diskLoadPath in _diskLoadPaths) { - try - { - var path = Path.Combine(diskLoadPath, dllName); - return new PEReader(File.OpenRead(path)); - } - catch (FileNotFoundException) + var path = Path.Combine(diskLoadPath, dllName); + + if (!File.Exists(path)) { + continue; } + + return new PEReader(File.OpenRead(path)); } var extraStream = _parent.ExtraRobustLoader?.Invoke(dllName);