umco / umbraco-vorto

1:1 multilingual property editor wrapper for Umbraco
https://our.umbraco.org/projects/backoffice-extensions/vorto
MIT License
44 stars 42 forks source link

NullReferenceException when attempting to GetVortoValue for search index padding #88

Closed robertjf closed 6 years ago

robertjf commented 7 years ago

The following line (https://github.com/umco/umbraco-vorto/blob/master/src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs#L96) leads to a NullReferenceException when attempting to extract Vorto values while padding search indexes because the UmbracoContext is not initialised:

var inPreviewMode = UmbracoContext.Current.InPreviewMode;

This is on Umbraco 7.6.1, not sure about earlier versions (but I suspect the same issue)

mattbrailsford commented 6 years ago

PR Merged