viewport_info can be NULL. Check for this.