Solutionunvalidated
Add a null guard before mutating nested properties (e.g., `if (state) { state.role = action.payload; }`). For setUser, return the next state value instead of reassigning `state` (e.g., `return action.payload`).
bff39d0b-b580-4c03-8c44-d0de2667469d
Add a null guard before mutating nested properties (e.g., if (state) { state.role = action.payload; }). For setUser, return the next state value instead of reassigning state (e.g., return action.payload).