Indexing items with the Security field set to null causes warnings


Description

If the Security field is set to null, for example, using API item[FieldIDs.Security] = null, then warnings might occur during search index updates:

 WARN  ItemSecurityChangeDetector: Error during parsing the rule
Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: serializedData
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
   at Sitecore.Security.AccessControl.AccessRuleSerializer.Deserialize(String serializedData)
   at Sitecore.ContentSearch.Security.ItemSecurityChangeDetector.TryDeserializeAccessRules(String serializedRules, AccessRuleCollection& result)
WARN ItemSecurityChangeDetector: Can't parse new value of the '{AAA8A2A5-A3CF-4876-A876-8A69A2876098}' field

Note: These warnings do not impact search behavior and can be ignored.

Solution

To resolve the issue, consider one of the following options: