dont assume main window viewmodel is present.
MODIFY
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -83,9 +83,9 @@ namespace WalletWasabi.Gui.ViewModels
public UiConfig UiConfig { get; }
public IShell Shell { get; }
public WalletManager WalletManager { get; }
- public static MainWindowViewModel Instance { get; internal set; }
+ public static MainWindowViewModel? Instance { get; internal set; }
- public ModalDialogViewModelBase ModalDialog
+ public ModalDialogViewModelBase? ModalDialog
{
get => _modalDialog;
private set => this.RaiseAndSetIfChanged(ref _modalDialog, value);

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -406,6 +406,11 @@ namespace WalletWasabi.Gui.ViewModels
private void OnResponseArrivedIsGenSocksServFail(bool isGenSocksServFail)
{
+ if (MainWindowViewModel.Instance is null)
+ {
+ return;
+ }
+
if (isGenSocksServFail)
{
// Is close band present?

dont assume main window viewmodel is present.