diff --git a/src/extensions/mod_management/reducers/mods.ts b/src/extensions/mod_management/reducers/mods.ts index 009c31b4a..9e26f46ee 100644 --- a/src/extensions/mod_management/reducers/mods.ts +++ b/src/extensions/mod_management/reducers/mods.ts @@ -173,10 +173,17 @@ export const modsReducer: IReducerSpec = { }, [actions.setFileOverride as any]: (state, payload) => { const { gameId, modId, files } = payload; - + if (!Array.isArray(files)) { + // this should never happen + return state; + } if (state[gameId]?.[modId] === undefined) { return state; } + const hasInvalidEntry = files.find(file => (typeof file !== 'string')) !== undefined; + if (hasInvalidEntry) { + return state; + } return setSafe(state, [gameId, modId, 'fileOverrides'], files); },