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 _);