From 89df77f605019b493d3815d3b7e0652936c877d8 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 15 Apr 2019 20:03:21 +0200 Subject: [PATCH] Update GrainTextIndexer.cs --- .../Contents/Text/GrainTextIndexer.cs | 5 +++++ 1 file changed, 5 insertions(+) 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;