Skip to content

Commit 3db4920

Browse files
committed
fixed odd case where attempting to update LO with null parameters
fixes #17047
1 parent 42feb21 commit 3db4920

File tree

1 file changed

+3
-2
lines changed
  • src/extensions/file_based_loadorder

1 file changed

+3
-2
lines changed

src/extensions/file_based_loadorder/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,9 @@ export default function init(context: IExtensionContext) {
370370
context.registerActionCheck('SET_FB_LOAD_ORDER', (state, action: any) => {
371371
const { profileId, loadOrder } = action.payload;
372372
const profile = selectors.profileById(state, profileId);
373-
if (updateSet && profile !== undefined) {
374-
updateSet.init(profile.gameId, loadOrder.map((lo, idx) => ({ ...lo, index: idx })));
373+
const gameId = profile?.gameId ?? selectors.activeGameId(state);
374+
if (updateSet && gameId) {
375+
updateSet.init(gameId, (loadOrder ?? []).map((lo, idx) => ({ ...lo, index: idx })));
375376
}
376377
return undefined;
377378
});

0 commit comments

Comments
 (0)