From 87771b55cb75764146abbc6e1b5e9a3932d76110 Mon Sep 17 00:00:00 2001 From: KakaruHayate Date: Fri, 26 Jun 2026 11:30:30 +0800 Subject: [PATCH] Fix silent crash when dragging invalid .oudep file onto window The drag-and-drop OUDEP installer path in MainWindow.OnDrop lacked error handling around PackageManager.InstallFromFileAsync. Any validation failure (e.g. missing oudep.yaml, empty entrypoints, invalid package id) threw an unhandled exception that crashed the app because async void methods have no caller to catch. Wrap the call in try/catch and show the error in a message box, matching the pattern already used in OnMenuInstallSinger. --- OpenUtau/Views/MainWindow.axaml.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenUtau/Views/MainWindow.axaml.cs b/OpenUtau/Views/MainWindow.axaml.cs index 4dcb7e32b..e895c1d5a 100644 --- a/OpenUtau/Views/MainWindow.axaml.cs +++ b/OpenUtau/Views/MainWindow.axaml.cs @@ -986,7 +986,14 @@ async void OnDrop(object? sender, DragEventArgs args) { ThemeManager.GetString("dialogs.installdependency.caption"), MessageBox.MessageBoxButtons.OkCancel); if (result == MessageBox.MessageBoxResult.Ok) { - await PackageManager.Inst.InstallFromFileAsync(file); + try { + await PackageManager.Inst.InstallFromFileAsync(file); + } catch (Exception e) { + Log.Error(e, $"Failed to install dependency {file}"); + _ = await MessageBox.ShowError(this, new MessageCustomizableException( + $"Failed to install dependency {file}", + $": {file}", e)); + } } } }