Fix and catch exception.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -8,6 +8,7 @@ using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using WalletWasabi.Models;
+using WalletWasabi.Logging;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -78,6 +79,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
private async Task RewriteTableAsync()
+ {
+ try
{
var txRecordList = await Task.Run(() =>
{
@@ -108,6 +111,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
RefreshOrdering();
}
+ catch (Exception ex)
+ {
+ Logger.LogError<HistoryTabViewModel>($"Error while RewriteTable on HistoryTab: {ex}.");
+ }
+ }
private static List<(DateTimeOffset dateTime, Height height, Money amount, string label, uint256 transactionId)> BuildTxRecordList()
{
@@ -122,7 +130,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
break;
}
- SmartTransaction foundTransaction = Global.WalletService.TransactionCache.First(x => x.GetHash() == coin.TransactionId);
+ SmartTransaction foundTransaction = Global.WalletService.TransactionCache.FirstOrDefault(x => x.GetHash() == coin.TransactionId);
+ if (foundTransaction is null)
+ {
+ continue;
+ }
+
DateTimeOffset dateTime;
if (foundTransaction.Height.Type == HeightType.Chain)
{

Fix and catch exception.