diff --git a/src/view/form/control/AphrontFormPolicyControl.php b/src/view/form/control/AphrontFormPolicyControl.php index 32f5318a18..6448b2b8b2 100644 --- a/src/view/form/control/AphrontFormPolicyControl.php +++ b/src/view/form/control/AphrontFormPolicyControl.php @@ -167,12 +167,17 @@ final class AphrontFormPolicyControl extends AphrontFormControl { $type_project = PhabricatorPolicyType::TYPE_PROJECT; + // Make sure we have a "Projects" group before we adjust it. + if (empty($options[$type_project])) { + $options[$type_project] = array(); + } + + $options[$type_project] = isort($options[$type_project], 'sort'); + $placeholder = id(new PhabricatorPolicy()) ->setName(pht('Other Project...')) ->setIcon('fa-search'); - $options[$type_project] = isort($options[$type_project], 'sort'); - $options[$type_project][$this->getSelectProjectKey()] = array( 'name' => $placeholder->getName(), 'full' => $placeholder->getName(),