1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 12:47:39 +02:00

Make sure MercurialProcessor fails gracefully

This commit is contained in:
Jordi Boggiano
2016-09-29 09:17:31 +02:00
parent d72b886978
commit 6bf91fa40a

View File

@@ -51,9 +51,13 @@ class MercurialProcessor
}
$result = explode(' ', trim(`hg id -nb`));
return self::$cache = array(
'branch' => $result[1],
'revision' => $result[2],
);
if (count($result) >= 3) {
return self::$cache = array(
'branch' => $result[1],
'revision' => $result[2],
);
}
return self::$cache = array();
}
}