Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF6 committed Jan 3, 2025
1 parent 77e9b5e commit 41b292d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Argon.Api/Features/Orleanse/Streams/NatsAdapterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ public ArgonEventBatch(StreamId streamId, object data, Type getType, StreamSeque
{
var sequenceToken = (EventSequenceTokenV2)SequenceToken;

return Data.OfType<T>().Select((@event, i) => Tuple.Create<T, StreamSequenceToken?>(@event, sequenceToken.CreateSequenceTokenForEvent(i)));
if (sequenceToken is null)
throw new NullReferenceException($"Fucking mom of sequenceToken null, original '{SequenceToken.GetType().FullName}'");
if (Data is null)
throw new NullReferenceException($"Fucking mom of Data null");

var eta = Data.OfType<T>().ToList();
if (eta is null)
throw new NullReferenceException($"Fucking mom of eta null");


return eta.Select((@event, i) => Tuple.Create<T, StreamSequenceToken?>(@event, sequenceToken.CreateSequenceTokenForEvent(i)));
}

public bool ImportRequestContext() => false;
Expand Down

0 comments on commit 41b292d

Please sign in to comment.