mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
Fix a warning in the JIRA field
Summary: Ref T3687. The `value` property may be `null`. Test Plan: Loaded a revision with the JIRA field enabled but no issues attached, no longer saw a warning about a bad argument to `foreach()`. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3687 Differential Revision: https://secure.phabricator.com/D6890
This commit is contained in:
parent
2d240142c8
commit
470bb4931b
1 changed files with 8 additions and 6 deletions
|
@ -145,12 +145,14 @@ final class DifferentialJIRAIssuesFieldSpecification
|
|||
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
|
||||
|
||||
$refs = array();
|
||||
foreach ($this->value as $jira_key) {
|
||||
$refs[] = id(new DoorkeeperObjectRef())
|
||||
->setApplicationType(DoorkeeperBridgeJIRA::APPTYPE_JIRA)
|
||||
->setApplicationDomain($provider->getProviderDomain())
|
||||
->setObjectType(DoorkeeperBridgeJIRA::OBJTYPE_ISSUE)
|
||||
->setObjectID($jira_key);
|
||||
if ($this->value) {
|
||||
foreach ($this->value as $jira_key) {
|
||||
$refs[] = id(new DoorkeeperObjectRef())
|
||||
->setApplicationType(DoorkeeperBridgeJIRA::APPTYPE_JIRA)
|
||||
->setApplicationDomain($provider->getProviderDomain())
|
||||
->setObjectType(DoorkeeperBridgeJIRA::OBJTYPE_ISSUE)
|
||||
->setObjectID($jira_key);
|
||||
}
|
||||
}
|
||||
|
||||
return $refs;
|
||||
|
|
Loading…
Reference in a new issue