diff --git a/src/Squidex.Domain.Apps.Entities/Contents/Text/GrainTextIndexer.cs b/src/Squidex.Domain.Apps.Entities/Contents/Text/GrainTextIndexer.cs index fe005a4a37..f4b3ab2232 100644 --- a/src/Squidex.Domain.Apps.Entities/Contents/Text/GrainTextIndexer.cs +++ b/src/Squidex.Domain.Apps.Entities/Contents/Text/GrainTextIndexer.cs @@ -56,6 +56,11 @@ public async Task On(Envelope @event) if (@event.Payload is ContentEvent contentEvent) { var index = grainFactory.GetGrain(contentEvent.SchemaId.Id); + + if (index == null) + { + throw new InvalidOperationException("Cannot create reference to grain."); + } var id = contentEvent.ContentId;