Added null check to PermissionsHelper.