TRUNK-4228: SonarQube - Nullcheck of value previously dereferenced