diff --git a/lib/config/migration.ts b/lib/config/migration.ts index 9949fe1428cbb16ace65915f2319ca29903657f9..9d0404286217456dedfb367488c9dadf1350a4fb 100644 --- a/lib/config/migration.ts +++ b/lib/config/migration.ts @@ -219,7 +219,7 @@ export function migrateConfig( } else if (val[i] === ':library' || val[i] === 'config:library') { isMigrated = true; migratedConfig.extends[i] = 'config:js-lib'; - } else if (val[i].startsWith(':masterIssue')) { + } else if (val[i]?.startsWith(':masterIssue')) { isMigrated = true; migratedConfig.extends[i] = val[i].replace( 'masterIssue', diff --git a/lib/versioning/ruby/strategies/replace.ts b/lib/versioning/ruby/strategies/replace.ts index f9d925ee18105c63199a943b15777713ff204110..848fba0f37862d51bed6b489712b7488dcb72246 100644 --- a/lib/versioning/ruby/strategies/replace.ts +++ b/lib/versioning/ruby/strategies/replace.ts @@ -10,7 +10,7 @@ function isMajorRange(range: string): boolean { const splitRange = range.split(',').map((part) => part.trim()); return ( splitRange.length === 1 && - splitRange[0].startsWith('~>') && + splitRange[0]?.startsWith('~>') && countInstancesOf(splitRange[0], '.') === 0 ); } @@ -19,9 +19,9 @@ function isCommonRubyMajorRange(range: string): boolean { const splitRange = range.split(',').map((part) => part.trim()); return ( splitRange.length === 2 && - splitRange[0].startsWith('~>') && + splitRange[0]?.startsWith('~>') && countInstancesOf(splitRange[0], '.') === 1 && - splitRange[1].startsWith('>=') + splitRange[1]?.startsWith('>=') ); } @@ -29,9 +29,9 @@ function isCommonRubyMinorRange(range: string): boolean { const splitRange = range.split(',').map((part) => part.trim()); return ( splitRange.length === 2 && - splitRange[0].startsWith('~>') && + splitRange[0]?.startsWith('~>') && countInstancesOf(splitRange[0], '.') === 2 && - splitRange[1].startsWith('>=') + splitRange[1]?.startsWith('>=') ); }