1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 12:17:35 +02:00

Merge pull request #1438 from rickserrat/hotfix/gitprocessor

Check that  is not null before calling preg_match
This commit is contained in:
Jordi Boggiano
2020-03-13 17:46:09 +01:00
committed by GitHub

View File

@@ -52,7 +52,7 @@ class GitProcessor implements ProcessorInterface
}
$branches = `git branch -v --no-abbrev`;
if (preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) {
if ($branches && preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) {
return self::$cache = array(
'branch' => $matches[1],
'commit' => $matches[2],