Browse Source

More defensive partition calculation.

pull/691/head
Sebastian 5 years ago
parent
commit
87a4d0c275
  1. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Rules/EnrichedEvents/EnrichedCommentEvent.cs
  2. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Rules/EnrichedEvents/EnrichedSchemaEvent.cs
  3. 2
      backend/src/Squidex.Domain.Apps.Core.Model/Rules/EnrichedEvents/EnrichedUsageExceededEvent.cs

2
backend/src/Squidex.Domain.Apps.Core.Model/Rules/EnrichedEvents/EnrichedCommentEvent.cs

@ -25,7 +25,7 @@ namespace Squidex.Domain.Apps.Core.Rules.EnrichedEvents
[IgnoreDataMember] [IgnoreDataMember]
public override long Partition public override long Partition
{ {
get => MentionedUser.Id.GetHashCode(); get => MentionedUser?.Id.GetHashCode() ?? 0;
} }
public bool ShouldSerializeMentionedUser() public bool ShouldSerializeMentionedUser()

2
backend/src/Squidex.Domain.Apps.Core.Model/Rules/EnrichedEvents/EnrichedSchemaEvent.cs

@ -20,7 +20,7 @@ namespace Squidex.Domain.Apps.Core.Rules.EnrichedEvents
public override long Partition public override long Partition
{ {
get => SchemaId.GetHashCode(); get => SchemaId?.GetHashCode() ?? 0;
} }
} }
} }

2
backend/src/Squidex.Domain.Apps.Core.Model/Rules/EnrichedEvents/EnrichedUsageExceededEvent.cs

@ -15,7 +15,7 @@ namespace Squidex.Domain.Apps.Core.Rules.EnrichedEvents
public override long Partition public override long Partition
{ {
get => AppId.GetHashCode(); get => AppId?.GetHashCode() ?? 0;
} }
} }
} }

Loading…
Cancel
Save