Skip to content

Commit

Permalink
Fix #5960 - catch exception when baseline cannot be located
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Jun 20, 2021
1 parent 0a57c86 commit f73f229
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Psalm/Internal/Cli/Psalm.php
Expand Up @@ -618,10 +618,14 @@ private static function generateBaseline(
): array {
fwrite(STDERR, 'Writing error baseline to file...' . PHP_EOL);

$issue_baseline = ErrorBaseline::read(
new \Psalm\Internal\Provider\FileProvider,
$options['set-baseline']
);
try {
$issue_baseline = ErrorBaseline::read(
new \Psalm\Internal\Provider\FileProvider,
$options['set-baseline']
);
} catch (\Psalm\Exception\ConfigException $e) {
$issue_baseline = [];
}

ErrorBaseline::create(
new \Psalm\Internal\Provider\FileProvider,
Expand Down

0 comments on commit f73f229

Please sign in to comment.