Page MenuHomePhabricator

D7302.id16434.diff
No OneTemporary

D7302.id16434.diff

Index: src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php
===================================================================
--- src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php
+++ src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php
@@ -46,6 +46,9 @@
foreach ($releephRequests as $releephRequest) {
$branch = $releephRequest->loadReleephBranch();
+ if (!$branch) {
+ continue;
+ }
$request_commit_phid = $releephRequest->getRequestCommitPHID();
$revisionPHID =
$query->getRevisionPHID($request_commit_phid);
Index: src/applications/releeph/query/ReleephRequestQuery.php
===================================================================
--- src/applications/releeph/query/ReleephRequestQuery.php
+++ src/applications/releeph/query/ReleephRequestQuery.php
@@ -10,6 +10,7 @@
private $severities;
private $requestorPHIDs;
private $branchIDs;
+ private $badRevisionsRequested;
const STATUS_ALL = 'status-all';
const STATUS_OPEN = 'status-open';
@@ -75,14 +76,19 @@
->execute();
$this->commitToRevMap = array();
-
+ $this->badRevisionsRequested = false;
foreach ($edges as $revision_phid => $edge) {
foreach ($edge[$type] as $commitPHID => $item) {
$this->commitToRevMap[$commitPHID] = $revision_phid;
}
}
+ if ($revision_phids && !$this->commitToRevMap) {
+ $this->badRevisionsRequested = true;
+ }
+
$this->requestedCommitPHIDs = array_keys($this->commitToRevMap);
+ return $this;
}
public function loadPage() {
@@ -137,6 +143,10 @@
private function buildWhereClause(AphrontDatabaseConnection $conn_r) {
$where = array();
+ if ($this->badRevisionsRequested) {
+ throw new PhabricatorEmptyQueryException("Malformed Revision Phids");
+ }
+
if ($this->ids) {
$where[] = qsprintf(
$conn_r,
Index: src/applications/releeph/storage/ReleephRequest.php
===================================================================
--- src/applications/releeph/storage/ReleephRequest.php
+++ src/applications/releeph/storage/ReleephRequest.php
@@ -56,6 +56,10 @@
*/
public function getPusherIntent() {
$project = $this->loadReleephProject();
+ if (!$project) {
+ return null;
+ }
+
if (!$project->getPushers()) {
return self::INTENT_WANT;
}
@@ -229,7 +233,10 @@
}
public function loadReleephProject() {
- return $this->loadReleephBranch()->loadReleephProject();
+ $branch = $this->loadReleephBranch();
+ if ($branch) {
+ return $branch->loadReleephProject();
+ }
}
public function loadPhabricatorRepositoryCommit() {

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 10, 6:10 AM (5 d, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7696625
Default Alt Text
D7302.id16434.diff (2 KB)

Event Timeline