diff --git a/UnitystationLauncher/ContentScanning/AssemblyTypeChecker.Config.cs b/UnitystationLauncher/ContentScanning/AssemblyTypeChecker.Config.cs index 28fd5c74..2cb20880 100644 --- a/UnitystationLauncher/ContentScanning/AssemblyTypeChecker.Config.cs +++ b/UnitystationLauncher/ContentScanning/AssemblyTypeChecker.Config.cs @@ -51,11 +51,14 @@ private async Task LoadConfig() var resourceName = "UnitystationLauncher.CodeScanList.json"; using (var stream = assembly.GetManifestResourceStream(resourceName)) { - // Copy the contents of the resource to a file location - using (var fileStream = File.Create(configPath)) + if (stream != null) { - stream.Seek(0L, SeekOrigin.Begin); - await stream.CopyToAsync(fileStream); + // Copy the contents of the resource to a file location + using (var fileStream = File.Create(configPath)) + { + stream.Seek(0L, SeekOrigin.Begin); + await stream.CopyToAsync(fileStream); + } } } Log.Error("had to use backup config"); diff --git a/UnitystationLauncher/Models/Api/Server.cs b/UnitystationLauncher/Models/Api/Server.cs index 8b586d73..6a3be60b 100644 --- a/UnitystationLauncher/Models/Api/Server.cs +++ b/UnitystationLauncher/Models/Api/Server.cs @@ -31,7 +31,7 @@ public Server(string forkName, int buildVersion, string serverIp, int serverPort public string? OsxDownload { get; set; } public string? LinuxDownload { get; set; } - public string ServerGoodFileVersion { get; set; } + public string ServerGoodFileVersion { get; set; } = string.Empty; public (string, int) ForkAndVersion => (ForkName, BuildVersion); diff --git a/UnitystationLauncher/Services/CodeScanService.cs b/UnitystationLauncher/Services/CodeScanService.cs index 407cb4d1..a514773a 100644 --- a/UnitystationLauncher/Services/CodeScanService.cs +++ b/UnitystationLauncher/Services/CodeScanService.cs @@ -80,7 +80,7 @@ public async Task OnScan(ZipArchive archive, string targetDirectory, strin - DirectoryInfo stagingManaged = null; + DirectoryInfo? stagingManaged = null; if (_environmentService.GetCurrentEnvironment() != CurrentEnvironment.MacOsStandalone) { // Get all files in the directory diff --git a/UnitystationLauncher/Services/HubBuildCommunicationPipeService.cs b/UnitystationLauncher/Services/HubBuildCommunicationPipeService.cs index d11ed0f7..47cedcf1 100644 --- a/UnitystationLauncher/Services/HubBuildCommunicationPipeService.cs +++ b/UnitystationLauncher/Services/HubBuildCommunicationPipeService.cs @@ -15,13 +15,13 @@ namespace UnitystationLauncher.Services; public static class HubBuildCommunicationPipeService { - private static PipeHubBuildCommunication coolPipeHubBuildCommunication; + private static PipeHubBuildCommunication? _coolPipeHubBuildCommunication; public static void Init() { var data = new PipeHubBuildCommunication(); _ = data.StartServerPipe(); - coolPipeHubBuildCommunication = data; + _coolPipeHubBuildCommunication = data; } diff --git a/UnitystationLauncher/ViewModels/ServersPanelViewModel.cs b/UnitystationLauncher/ViewModels/ServersPanelViewModel.cs index e72d9f46..454dad0f 100644 --- a/UnitystationLauncher/ViewModels/ServersPanelViewModel.cs +++ b/UnitystationLauncher/ViewModels/ServersPanelViewModel.cs @@ -41,7 +41,7 @@ public ServersPanelViewModel(IInstallationService installationService, IPingServ DownloadCommand = ReactiveCommand.Create(server => { - DownloadServer(server.Server); + _ = DownloadServer(server.Server); return Unit.Default; }); @@ -121,7 +121,7 @@ private async Task DownloadServer(Server server) if (download == null) { - MessageBoxBuilder.CreateMessageBox(MessageBoxButtons.Ok, "Problem downloading server", + _ = MessageBoxBuilder.CreateMessageBox(MessageBoxButtons.Ok, "Problem downloading server", downloadFailReason).Show(); return; }