diff --git a/src/applications/diffusion/request/DiffusionMercurialRequest.php b/src/applications/diffusion/request/DiffusionMercurialRequest.php index b626d62750..676dc097f7 100644 --- a/src/applications/diffusion/request/DiffusionMercurialRequest.php +++ b/src/applications/diffusion/request/DiffusionMercurialRequest.php @@ -3,6 +3,9 @@ final class DiffusionMercurialRequest extends DiffusionRequest { protected function isStableCommit($symbol) { + if ($symbol === null) { + return false; + } return preg_match('/^[a-f0-9]{40}\z/', $symbol); } @@ -10,11 +13,9 @@ final class DiffusionMercurialRequest extends DiffusionRequest { if ($this->branch) { return $this->branch; } - if ($this->repository) { return $this->repository->getDefaultBranch(); } - throw new Exception(pht('Unable to determine branch!')); } diff --git a/src/applications/diffusion/request/DiffusionSvnRequest.php b/src/applications/diffusion/request/DiffusionSvnRequest.php index 5f50366331..33fc3446f9 100644 --- a/src/applications/diffusion/request/DiffusionSvnRequest.php +++ b/src/applications/diffusion/request/DiffusionSvnRequest.php @@ -3,6 +3,9 @@ final class DiffusionSvnRequest extends DiffusionRequest { protected function isStableCommit($symbol) { + if ($symbol === null) { + return false; + } return preg_match('/^[1-9]\d*\z/', $symbol); }