mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Fix a rendering fatal for unknown edge constants
If we try to render an edge transaction which uses unknown edge constants, it turns out we fatal. Degrade instead. This happened when viewing very old badges. Auditors: chad
This commit is contained in:
parent
186460888d
commit
b4effdf26c
1 changed files with 9 additions and 1 deletions
|
@ -932,7 +932,15 @@ abstract class PhabricatorApplicationTransaction
|
||||||
$type = $this->getMetadata('edge:type');
|
$type = $this->getMetadata('edge:type');
|
||||||
$type = head($type);
|
$type = head($type);
|
||||||
|
|
||||||
$type_obj = PhabricatorEdgeType::getByConstant($type);
|
try {
|
||||||
|
$type_obj = PhabricatorEdgeType::getByConstant($type);
|
||||||
|
} catch (Exception $ex) {
|
||||||
|
// Recover somewhat gracefully from edge transactions which
|
||||||
|
// we don't have the classes for.
|
||||||
|
return pht(
|
||||||
|
'%s edited an edge.',
|
||||||
|
$this->renderHandleLink($author_phid));
|
||||||
|
}
|
||||||
|
|
||||||
if ($add && $rem) {
|
if ($add && $rem) {
|
||||||
return $type_obj->getTransactionEditString(
|
return $type_obj->getTransactionEditString(
|
||||||
|
|
Loading…
Reference in a new issue