1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Fix #5960 - catch exception when baseline cannot be located

This commit is contained in:
Matt Brown 2021-06-20 19:03:20 -04:00
parent 0a57c86549
commit f73f2299db

View File

@ -618,10 +618,14 @@ final class Psalm
): 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,