Skip to content

Commit

Permalink
account nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Jan 30, 2025
1 parent 3cf9072 commit f573756
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Assets/Dojo/Runtime/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private Controller(dojo.Controller* controller)
this.controller = controller;
}

public static Controller GetAccount(Policy[] policies, FieldElement chainId)
public static Controller? GetAccount(Policy[] policies, FieldElement chainId)
{
dojo.Policy* policiesPtr = null;
if (policies.Length > 0)
Expand All @@ -32,7 +32,8 @@ public static Controller GetAccount(Policy[] policies, FieldElement chainId)
var result = dojo.controller_account(policiesPtr, (UIntPtr)policies.Length, chainId.Inner);
if (result.tag == dojo.ResultController_Tag.ErrController)
{
throw new Exception(result.err.message);
Debug.LogWarning(result.err.message);
return null;
}

return new Controller(result._ok);
Expand Down

0 comments on commit f573756

Please sign in to comment.