Add a missing null pointer check after r148759.