Skip to content

Commit 28045f5

Browse files
Merge pull request #12 from totalretribution/crashfix
2 parents fa63f6a + 53dc652 commit 28045f5

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/SshAgentEcho.Gui/Program.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ public static void Main(string[] args) {
2121
return;
2222
}
2323

24-
BuildAvaloniaApp()
25-
.StartWithClassicDesktopLifetime(args);
24+
try {
25+
BuildAvaloniaApp()
26+
.StartWithClassicDesktopLifetime(args);
27+
} catch (NullReferenceException ex) when (ex.StackTrace?.Contains("DBusMenu") == true || ex.StackTrace?.Contains("Tmds.DBus") == true) {
28+
Console.WriteLine($"Suppressing DBus shutdown error: {ex.Message}");
29+
} catch (Exception ex) {
30+
Console.WriteLine($"Unhandled exception: {ex}");
31+
} finally {
32+
_mutex.ReleaseMutex();
33+
}
2634
}
2735

2836
// Avalonia configuration, don't remove; also used by visual designer.

0 commit comments

Comments
 (0)