1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +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_phid = null;
$latest_transaction_id = null;
$can_edit = false;
} else {
$this->setConpherence($conpherence);
@ -78,6 +79,10 @@ final class ConpherenceColumnViewController extends
$conpherence_id = $conpherence->getID();
$conpherence_phid = $conpherence->getPHID();
$latest_transaction_id = $latest_transaction->getID();
$can_edit = PhabricatorPolicyFilter::hasCapability(
$user,
$conpherence,
PhabricatorPolicyCapability::CAN_EDIT);
}
$response = array(
@ -85,10 +90,7 @@ final class ConpherenceColumnViewController extends
'threadID' => $conpherence_id,
'threadPHID' => $conpherence_phid,
'latestTransactionID' => $latest_transaction_id,
'canEdit' => PhabricatorPolicyFilter::hasCapability(
$user,
$conpherence,
PhabricatorPolicyCapability::CAN_EDIT),
'canEdit' => $can_edit,
);
return id(new AphrontAjaxResponse())->setContent($response);