|
@@ -103,7 +103,7 @@ public class MainWindowViewModel : ViewModelBase
|
|
|
|
|
|
try
|
|
|
{
|
|
|
- Changelogs = new ObservableCollection<Changelog>(await Downloader.DownloadAndDeserializeJsonData<List<Changelog>>("https://files.veloe.link/launcher/changelog.json"));
|
|
|
+ Changelogs = new ObservableCollection<Changelog>(await Downloader.DownloadAndDeserializeJsonData<List<Changelog>>("https://files.veloe.link/launcher/changelog.json") ?? new List<Changelog>());
|
|
|
this.RaisePropertyChanged(nameof(Changelogs));
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -622,7 +622,7 @@ public class MainWindowViewModel : ViewModelBase
|
|
|
StartButtonOutput = "";
|
|
|
IsNoGameRunning = true;
|
|
|
if (minecraftProcess.ExitCode is not (0 or 2))
|
|
|
- OpenErrorWindow(new JavaProcessException($"Minecraft process exited with an error code {minecraftProcess.ExitCode}.\nCheck log in game folder or launcher console.", $"{Settings.minecraftForlderPath}versions/{_startedVersion.Version}/crash-reports"));
|
|
|
+ OpenErrorWindow(new JavaProcessException($"Minecraft process exited with an error code {minecraftProcess.ExitCode}.\nCheck log in game folder or launcher console.", $"{Settings.minecraftForlderPath}versions/{_startedVersion?.Version ?? "NULL"}/crash-reports"));
|
|
|
else if (minecraftProcess.ExitCode is 2)
|
|
|
{
|
|
|
OpenErrorWindow(new Exception("JVM exited on the startup (Exit code 2). Check your Java installation. Get more info in the laucher console."));
|
|
@@ -779,9 +779,9 @@ public class MainWindowViewModel : ViewModelBase
|
|
|
if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
using var updaterProcess = Process.Start(new ProcessStartInfo() { FileName = fileName, Arguments = " --version", RedirectStandardOutput = true });
|
|
|
- updaterProcess.WaitForExit();
|
|
|
+ updaterProcess?.WaitForExit();
|
|
|
|
|
|
- var versionStr = System.Text.RegularExpressions.Regex.Match(updaterProcess.StandardOutput.ReadToEnd(), "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+").Value;
|
|
|
+ var versionStr = System.Text.RegularExpressions.Regex.Match(updaterProcess?.StandardOutput.ReadToEnd() ?? string.Empty, "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+").Value;
|
|
|
if (!string.IsNullOrWhiteSpace(versionStr) &&
|
|
|
latestLauncherVersion?.Updater is not null &&
|
|
|
!(new Version(latestLauncherVersion.Updater) > new Version(versionStr)))
|