diff --git a/src/Psalm/ErrorBaseline.php b/src/Psalm/ErrorBaseline.php index 7d169b9d5..49bae03e6 100644 --- a/src/Psalm/ErrorBaseline.php +++ b/src/Psalm/ErrorBaseline.php @@ -81,6 +81,10 @@ class ErrorBaseline $xmlSource = $fileProvider->getContents($baselineFile); + if ($xmlSource === '') { + throw new Exception\ConfigException('Baseline file is empty'); + } + $baselineDoc = new \DOMDocument(); $baselineDoc->loadXML($xmlSource, LIBXML_NOBLANKS);