1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 17:22:42 +01:00

Conpherence - fix possible fatal

Summary: if users have no conpherences I think this is possible? just init it with the rest of the variables we init when we have no conpherence and we should be good to go. fixes T7671.

Test Plan: logicypoo

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7671

Differential Revision: https://secure.phabricator.com/D12227
This commit is contained in:
Bob Trahan 2015-03-31 14:13:41 -07:00
parent d403700e1f
commit e0acb75be9

View file

@ -56,6 +56,7 @@ final class ConpherenceColumnViewController extends
$conpherence_id = null; $conpherence_id = null;
$conpherence_phid = null; $conpherence_phid = null;
$latest_transaction_id = null; $latest_transaction_id = null;
$can_edit = false;
} else { } else {
$this->setConpherence($conpherence); $this->setConpherence($conpherence);
@ -78,6 +79,10 @@ final class ConpherenceColumnViewController extends
$conpherence_id = $conpherence->getID(); $conpherence_id = $conpherence->getID();
$conpherence_phid = $conpherence->getPHID(); $conpherence_phid = $conpherence->getPHID();
$latest_transaction_id = $latest_transaction->getID(); $latest_transaction_id = $latest_transaction->getID();
$can_edit = PhabricatorPolicyFilter::hasCapability(
$user,
$conpherence,
PhabricatorPolicyCapability::CAN_EDIT);
} }
$response = array( $response = array(
@ -85,10 +90,7 @@ final class ConpherenceColumnViewController extends
'threadID' => $conpherence_id, 'threadID' => $conpherence_id,
'threadPHID' => $conpherence_phid, 'threadPHID' => $conpherence_phid,
'latestTransactionID' => $latest_transaction_id, 'latestTransactionID' => $latest_transaction_id,
'canEdit' => PhabricatorPolicyFilter::hasCapability( 'canEdit' => $can_edit,
$user,
$conpherence,
PhabricatorPolicyCapability::CAN_EDIT),
); );
return id(new AphrontAjaxResponse())->setContent($response); return id(new AphrontAjaxResponse())->setContent($response);