1
0
Fork 0
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:
epriestley 2013-09-05 16:51:13 -07:00
parent 2d240142c8
commit 470bb4931b

View file

@ -145,6 +145,7 @@ final class DifferentialJIRAIssuesFieldSpecification
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
$refs = array();
if ($this->value) {
foreach ($this->value as $jira_key) {
$refs[] = id(new DoorkeeperObjectRef())
->setApplicationType(DoorkeeperBridgeJIRA::APPTYPE_JIRA)
@ -152,6 +153,7 @@ final class DifferentialJIRAIssuesFieldSpecification
->setObjectType(DoorkeeperBridgeJIRA::OBJTYPE_ISSUE)
->setObjectID($jira_key);
}
}
return $refs;
}