[[ Bugfix 13480 ]] Fix a potential nil pointer crash