Skip to content

Commit

Permalink
Fix NRE in MediaFieldIndexHandler (#11066)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt committed Jan 24, 2022
1 parent 6608cc0 commit 3caf280
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -39,9 +39,16 @@ public async override Task BuildIndexAsync(MediaField field, BuildFieldIndexCont
{
foreach (var key in context.Keys)
{
foreach (var mediaText in field.MediaTexts)
if (field.MediaTexts != null)
{
context.DocumentIndex.Set(key + MediaTextKeySuffix, mediaText, options);
foreach (var mediaText in field.MediaTexts)
{
context.DocumentIndex.Set(key + MediaTextKeySuffix, mediaText, options);
}
}
else
{
context.DocumentIndex.Set(key + MediaTextKeySuffix, "NULL", options);
}
}
}
Expand Down

0 comments on commit 3caf280

Please sign in to comment.