Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SysManager/SysManager/Helpers/AdminHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static bool IsElevated()
/// </summary>
public static bool RelaunchAsAdmin(string? argumentHint = null)
{
if (System.Windows.Application.Current == null) return false;
try
{
using var currentProc = Process.GetCurrentProcess();
Expand Down
1 change: 1 addition & 0 deletions SysManager/SysManager/Services/DialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static IDialogService Instance
/// <inheritdoc/>
public bool Confirm(string message, string title)
{
if (Application.Current == null) return false;
var result = MessageBox.Show(message, title, MessageBoxButton.YesNo, MessageBoxImage.Question);
return result == MessageBoxResult.Yes;
}
Expand Down
1 change: 1 addition & 0 deletions SysManager/SysManager/ViewModels/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ private void OpenDownloadFolder()

private static void OpenUrl(string url)
{
if (System.Windows.Application.Current == null) return;
try { Process.Start(new ProcessStartInfo(url) { UseShellExecute = true }); }
catch (InvalidOperationException) { /* best-effort */ }
catch (System.ComponentModel.Win32Exception) { /* best-effort */ }
Expand Down
Loading