Add missing null check reported by Amaury Pouly.