Skip to content

Commit

Permalink
fixed odd case where attempting to update LO with null parameters
Browse files Browse the repository at this point in the history
fixes #17047
  • Loading branch information
IDCs committed Jan 21, 2025
1 parent 42feb21 commit 3db4920
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/extensions/file_based_loadorder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,9 @@ export default function init(context: IExtensionContext) {
context.registerActionCheck('SET_FB_LOAD_ORDER', (state, action: any) => {
const { profileId, loadOrder } = action.payload;
const profile = selectors.profileById(state, profileId);
if (updateSet && profile !== undefined) {
updateSet.init(profile.gameId, loadOrder.map((lo, idx) => ({ ...lo, index: idx })));
const gameId = profile?.gameId ?? selectors.activeGameId(state);
if (updateSet && gameId) {
updateSet.init(gameId, (loadOrder ?? []).map((lo, idx) => ({ ...lo, index: idx })));
}
return undefined;
});
Expand Down

0 comments on commit 3db4920

Please sign in to comment.