Skip to content

Commit

Permalink
fix(account): fix TryParse throwing NullReferenceException when g…
Browse files Browse the repository at this point in the history
…iven string is null
  • Loading branch information
jasonboukheir committed Feb 27, 2023
1 parent abdedaf commit 142bc3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Runtime/Algorand.Unity/Accounts/Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ public static AddressFormatError TryParse<TString>(TString s, out Address addres
/// </summary>
public static AddressFormatError TryParse(string s, out Address address)
{
if (s == null)
{
address = default;
return AddressFormatError.IncorrectLength;
}
using var nativeS = new NativeText(s, Allocator.Temp);
return TryParse(nativeS, out address);
}
Expand Down

0 comments on commit 142bc3b

Please sign in to comment.