Use is keyword instead of == operator to check for null
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -141,7 +141,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
List<Transaction> trs = new List<Transaction>();
var txRecordList = new List<(DateTimeOffset dateTime, Height height, Money amount, string label, uint256 transactionId)>();
- if (walletService == null)
+ if (walletService is null)
{
return txRecordList;
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -170,7 +170,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
_addresses?.Clear();
var walletService = Global.WalletService;
- if (walletService == null)
+ if (walletService is null)
{
return;
}

MODIFY
WalletWasabi.Gui/MainWindow.xaml.cs
WalletWasabi.Gui/MainWindow.xaml.cs
@@ -54,7 +54,7 @@ namespace WalletWasabi.Gui
protected override void OnDataContextEndUpdate()
{
- if (Global == null)
+ if (Global is null)
return;
Application.Current.Resources.AddOrReplace(Global.GlobalResourceKey, Global);
Application.Current.Resources.AddOrReplace(Global.ConfigResourceKey, Global.Config);

MODIFY
WalletWasabi/TorSocks5/TorProcessManager.cs
WalletWasabi/TorSocks5/TorProcessManager.cs
@@ -45,7 +45,7 @@ namespace WalletWasabi.TorSocks5
public void Start(bool ensureRunning, string dataDir)
{
- if (TorSocks5EndPoint == null)
+ if (TorSocks5EndPoint is null)
{
return;
}
@@ -215,7 +215,7 @@ namespace WalletWasabi.TorSocks5
public async Task<bool> IsTorRunningAsync()
{
- if (TorSocks5EndPoint == null)
+ if (TorSocks5EndPoint is null)
{
return true;
}
@@ -248,7 +248,7 @@ namespace WalletWasabi.TorSocks5
public void StartMonitor(TimeSpan torMisbehaviorCheckPeriod, TimeSpan checkIfRunningAfterTorMisbehavedFor, string dataDirToStartWith, Uri fallBackTestRequestUri)
{
- if (TorSocks5EndPoint == null)
+ if (TorSocks5EndPoint is null)
{
return;
}
@@ -326,7 +326,7 @@ namespace WalletWasabi.TorSocks5
{
Interlocked.CompareExchange(ref _running, 2, 1); // If running, make it stopping.
- if (TorSocks5EndPoint == null)
+ if (TorSocks5EndPoint is null)
{
Interlocked.Exchange(ref _running, 3);
}

Use is keyword instead of == operator to check for null