fix invalid definition handling

This commit is contained in:
Henry Jameson 2026-04-10 01:16:22 +03:00
commit 6fa671e6c8

View file

@ -763,6 +763,8 @@ export const validateSetting = ({
defaultState, defaultState,
validateObjects = true, validateObjects = true,
}) => { }) => {
if (value === undefined) return undefined // only null is allowed as missing value
if (definition === undefined) return undefined // invalid definition
const path = fullPath.replace(/^simple./, '') const path = fullPath.replace(/^simple./, '')
if ( if (
validateObjects && validateObjects &&
@ -781,7 +783,6 @@ export const validateSetting = ({
console.log(path) console.log(path)
console.log('====') console.log('====')
} }
if (value === undefined) return undefined // only null is allowed as missing value
if (get(defaultState, path.split('.')[0]) === undefined) { if (get(defaultState, path.split('.')[0]) === undefined) {
const string = `Unknown option ${fullPath}, value: ${value}` const string = `Unknown option ${fullPath}, value: ${value}`