London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

ContentRepository.TryGet throws NullReferenceException when passed non-registered language

Fixed in

EPiServer.CMS.Core 12.14.0

(Or a related package)

Created

Mar 02, 2023

Updated

Apr 18, 2023

Area

CMS Core

State

Closed, Fixed and tested


Description

Fixed an issue where passing a valid, but non registered language to ContentRepository.TryGet resulted in a NullReferenceException. The method should return false, and the out parameter should be null.

For example:

_contentRepository.TryGet(contentLink, CultureInfo.GetCultureInfo("en-NF"), out _);