Skip to content

Commit

Permalink
Check TransferTicket.TicketerId for null
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxan committed Jul 30, 2023
1 parent e5e7d7b commit bfed9f2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Tzkt.Api/Repositories/OperationRepository.TransferTicket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ INNER JOIN ""Blocks"" as b
StorageUsed = row.StorageUsed,
BakerFee = row.BakerFee,
StorageFee = row.StorageFee ?? 0,
Target = Accounts.GetAlias(row.TargetId),
Ticketer = Accounts.GetAlias(row.TicketerId),
Target = row.TargetId == null ? null : Accounts.GetAlias(row.TargetId) ,
Ticketer = row.TicketerId == null ? null : Accounts.GetAlias(row.TicketerId),
Amount = row.Amount,
Entrypoint = row.Entrypoint,
ContentType = (RawJson)Micheline.ToJson(row.RawType),
Expand Down Expand Up @@ -104,8 +104,8 @@ INNER JOIN ""Blocks"" as b
StorageUsed = row.StorageUsed,
BakerFee = row.BakerFee,
StorageFee = row.StorageFee ?? 0,
Target = Accounts.GetAlias(row.TargetId),
Ticketer = Accounts.GetAlias(row.TicketerId),
Target = row.TargetId == null ? null : Accounts.GetAlias(row.TargetId),
Ticketer = row.TicketerId == null ? null : Accounts.GetAlias(row.TicketerId),
Amount = row.Amount,
Entrypoint = row.Entrypoint,
ContentType = (RawJson)Micheline.ToJson(row.RawType),
Expand Down Expand Up @@ -149,8 +149,8 @@ SELECT o.*
StorageUsed = row.StorageUsed,
BakerFee = row.BakerFee,
StorageFee = row.StorageFee ?? 0,
Target = Accounts.GetAlias(row.TargetId),
Ticketer = Accounts.GetAlias(row.TicketerId),
Target = row.TargetId == null ? null : Accounts.GetAlias(row.TargetId),
Ticketer = row.TicketerId == null ? null : Accounts.GetAlias(row.TicketerId),
Amount = row.Amount,
Entrypoint = row.Entrypoint,
ContentType = (RawJson)Micheline.ToJson(row.RawType),
Expand Down Expand Up @@ -225,8 +225,8 @@ INNER JOIN ""Blocks"" as b
StorageUsed = row.StorageUsed,
BakerFee = row.BakerFee,
StorageFee = row.StorageFee ?? 0,
Target = Accounts.GetAlias(row.TargetId),
Ticketer = Accounts.GetAlias(row.TicketerId),
Target = row.TargetId == null ? null : Accounts.GetAlias(row.TargetId),
Ticketer = row.TicketerId == null ? null : Accounts.GetAlias(row.TicketerId),
Amount = row.Amount,
Entrypoint = row.Entrypoint,
ContentType = (RawJson)Micheline.ToJson(row.RawType),
Expand Down Expand Up @@ -392,11 +392,11 @@ public async Task<object[][]> GetTransferTicketOps(
break;
case "target":
foreach (var row in rows)
result[j++][i] = await Accounts.GetAliasAsync(row.TargetId);
result[j++][i] = row.TargetId == null ? null : await Accounts.GetAliasAsync(row.TargetId);
break;
case "ticketer":
foreach (var row in rows)
result[j++][i] = await Accounts.GetAliasAsync(row.TicketerId);
result[j++][i] = row.TicketerId == null ? null : await Accounts.GetAliasAsync(row.TicketerId);
break;
case "amount":
foreach (var row in rows)
Expand Down Expand Up @@ -586,11 +586,11 @@ public async Task<object[]> GetTransferTicketOps(
break;
case "target":
foreach (var row in rows)
result[j++] = await Accounts.GetAliasAsync(row.TargetId);
result[j++] = row.TargetId == null ? null : await Accounts.GetAliasAsync(row.TargetId);
break;
case "ticketer":
foreach (var row in rows)
result[j++] = await Accounts.GetAliasAsync(row.TicketerId);
result[j++] = row.TicketerId == null ? null : await Accounts.GetAliasAsync(row.TicketerId);
break;
case "amount":
foreach (var row in rows)
Expand Down

0 comments on commit bfed9f2

Please sign in to comment.