Skip to content

Commit

Permalink
Change Tags default value from null to empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus committed Jul 31, 2023
1 parent e28dc5b commit c538527
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/Akka.Persistence.Query/EventEnvelope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ public sealed class EventEnvelope : IEquatable<EventEnvelope>
/// </summary>
[Obsolete("For binary compatibility with previous releases. Since 1.4.14")]
public EventEnvelope(Offset offset, string persistenceId, long sequenceNr, object @event)
: this(offset, persistenceId, sequenceNr, @event, 0L, null)
: this(offset, persistenceId, sequenceNr, @event, 0L, Array.Empty<string>())
{ }

/// <summary>
/// Initializes a new instance of the <see cref="EventEnvelope"/> class.
/// </summary>
[Obsolete("For binary compatibility with previous releases. Since 1.5.11")]
public EventEnvelope(Offset offset, string persistenceId, long sequenceNr, object @event, long timestamp)
: this(offset, persistenceId, sequenceNr, @event, timestamp, null)
: this(offset, persistenceId, sequenceNr, @event, timestamp, Array.Empty<string>())
{ }

public EventEnvelope(Offset offset, string persistenceId, long sequenceNr, object @event, long timestamp, string[]? tags)
public EventEnvelope(Offset offset, string persistenceId, long sequenceNr, object @event, long timestamp, string[] tags)
{
Offset = offset;
PersistenceId = persistenceId;
SequenceNr = sequenceNr;
Event = @event;
Timestamp = timestamp;
Tags = tags;
Tags = tags ?? Array.Empty<string>();
}

public Offset Offset { get; }
Expand All @@ -57,7 +57,7 @@ public EventEnvelope(Offset offset, string persistenceId, long sequenceNr, objec

public long Timestamp { get; }

public string[]? Tags { get; }
public string[] Tags { get; }

public bool Equals(EventEnvelope? other)
{
Expand Down

0 comments on commit c538527

Please sign in to comment.