diff --git a/src/applications/diffusion/request/DiffusionMercurialRequest.php b/src/applications/diffusion/request/DiffusionMercurialRequest.php
--- 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 @@
     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
--- 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);
   }