Ensure view_state.selected_role_id is an integer