Skip to content

Commit

Permalink
Merge pull request #1137 from maiko3tattun/0512_FixLaunchOU
Browse files Browse the repository at this point in the history
Fix OU not launching if project fails to open
  • Loading branch information
stakira authored Jun 9, 2024
2 parents 16b0158 + c5fc7c0 commit eff51fb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions OpenUtau/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ public void Redo() {
public void InitProject() {
var args = Environment.GetCommandLineArgs();
if (args.Length == 2 && File.Exists(args[1])) {
Core.Format.Formats.LoadProject(new string[] { args[1] });
DocManager.Inst.ExecuteCmd(new VoiceColorRemappingNotification(-1, true));
return;
try {
Core.Format.Formats.LoadProject(new string[] { args[1] });
DocManager.Inst.ExecuteCmd(new VoiceColorRemappingNotification(-1, true));
return;
} catch (Exception e) {
var customEx = new MessageCustomizableException($"Failed to open file {args[1]}", $"<translate:errors.failed.openfile>: {args[1]}", e);
DocManager.Inst.ExecuteCmd(new ErrorMessageNotification(customEx));
}
}
NewProject();
}
Expand Down

0 comments on commit eff51fb

Please sign in to comment.