### What happened? ### Description Spotted this when working on different feature branches, so an edge case perhaps. ### Steps to reproduce 1. Create a new branch with a new user group. 2. Create a new user group and assign a user to that group (and that group only). 3. Switch to a different branch and run project config migration. At this point, the following error is thrown in the console: ``` error: Cannot assign null to property craft\events\UserGroupEvent::$userGroup of type craft\models\UserGroup Failed to run craft up: exit status 1 ``` ### Expected behavior User group can be removed from project config without error. ### Actual behavior Migration fails where users are assigned solely to the removed group. ### Craft CMS version 4.10.5 ### PHP version 8.2.18 ### Operating system and version _No response_ ### Database type and version _No response_ ### Image driver and version _No response_ ### Installed plugins and versions -