Skip to content

Commit

Permalink
Skipping accounts if none exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
kilogold committed Apr 9, 2024
1 parent 0b5743b commit 64fc052
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Solana.Unity.Anchor.Tool/AnchorSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ static int Main(string[] args)
var jsonParsed = JObject.Parse(idlStr);

// Set UnixTimestamp to Int64 in accounts
foreach (JToken account in (JArray)jsonParsed["accounts"])
if (!jsonParsed.TryGetValue("accounts", out JToken val))
{
val = new JArray();
}

foreach (JToken account in (JArray)val)
{
JToken accountType = account["type"];
foreach (JObject fields in (JArray)accountType["fields"])
Expand Down

0 comments on commit 64fc052

Please sign in to comment.