Skip to content

Commit

Permalink
error null reference in get request from dapp exchange intro file Sto…
Browse files Browse the repository at this point in the history
…re method Set property map
  • Loading branch information
MassoudKargar committed Jun 6, 2024
1 parent a1cebf4 commit 639a2d7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions WalletConnectSharp.Core/Controllers/Store.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
Expand Down Expand Up @@ -150,9 +150,17 @@ public Task Set(TKey key, TValue value)
{
IsInitialized();

return !map.TryAdd(key, value)
? Update(key, value)
: Persist();
if (map == null)
{
map = new Dictionary<TKey, TValue>();
}
var b = !map.TryAdd(key, value);
if (b)
{
return Update(key, value);
}
else
{ return Persist(); }
}

/// <summary>
Expand Down

0 comments on commit 639a2d7

Please sign in to comment.