diff --git a/lib/config/migrations/custom/schedule-migration.ts b/lib/config/migrations/custom/schedule-migration.ts index 6ac6dc4cc45ce729d088369a43ba5e14b57a7893..3d5bd434ecb0821d84b0e91e47c5e5b73a49f8e2 100644 --- a/lib/config/migrations/custom/schedule-migration.ts +++ b/lib/config/migrations/custom/schedule-migration.ts @@ -29,7 +29,7 @@ export class ScheduleMigration extends AbstractMigration { schedules[i].replace(regEx(/( \d?\d)((a|p)m)/g), '$1:00$2') // TODO #12071 ).schedules[0]; // Only migrate if the after time is greater than before, e.g. "after 10pm and before 5am" - if (!parsedSchedule || !parsedSchedule.t_a || !parsedSchedule.t_b) { + if (!parsedSchedule?.t_a || !parsedSchedule.t_b) { continue; } diff --git a/lib/modules/datasource/galaxy-collection/index.ts b/lib/modules/datasource/galaxy-collection/index.ts index 9e1fd5df9a40c835fd9ef8cd192dce9399bac80c..1839445f1e64392df1a5b5562e3d5fd02120cb0a 100644 --- a/lib/modules/datasource/galaxy-collection/index.ts +++ b/lib/modules/datasource/galaxy-collection/index.ts @@ -43,7 +43,7 @@ export class GalaxyCollectionDatasource extends Datasource { this.handleGenericErrors(err); } - if (!baseUrlResponse || !baseUrlResponse.body) { + if (!baseUrlResponse?.body) { logger.warn( { dependency: packageName }, `Received invalid data from ${baseUrl}` diff --git a/lib/modules/datasource/helm/index.ts b/lib/modules/datasource/helm/index.ts index 621092c22836c4fd35f0e619b9bd7fd93f3b7097..5419c1d5aab5566394fc7694c7690dbf0dd1e157 100644 --- a/lib/modules/datasource/helm/index.ts +++ b/lib/modules/datasource/helm/index.ts @@ -37,7 +37,7 @@ export class HelmDatasource extends Datasource { res = await this.http.get('index.yaml', { baseUrl: ensureTrailingSlash(helmRepository), }); - if (!res || !res.body) { + if (!res?.body) { logger.warn( { helmRepository }, `Received invalid response from helm repository` diff --git a/lib/modules/versioning/maven/compare.ts b/lib/modules/versioning/maven/compare.ts index b5d54ed21fe11bc2a04be35805fb858c8c8ed577..c97629d61443292b3eb9bb3094d2859f1d2567bf 100644 --- a/lib/modules/versioning/maven/compare.ts +++ b/lib/modules/versioning/maven/compare.ts @@ -368,7 +368,7 @@ function parseRange(rangeStr: string): Range[] | null { if (interval.leftType) { return null; } // something like '[1,2],[3' - if (!ranges || !ranges.length) { + if (!ranges?.length) { return null; } diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts index 4163f4412eb36745d01fcf361b9e265133732410..8983d0d36fab405f4cedb222a579eceeef906af0 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts @@ -187,8 +187,7 @@ export default async function executePostUpgradeCommands( const updateUpgradeCommands: BranchUpgradeConfig[] = config.upgrades.filter( ({ postUpgradeTasks }) => - !postUpgradeTasks || - !postUpgradeTasks.executionMode || + !postUpgradeTasks?.executionMode || postUpgradeTasks.executionMode === 'update' );