1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 07:11:04 +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,12 +145,14 @@ final class DifferentialJIRAIssuesFieldSpecification
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); $provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
$refs = array(); $refs = array();
foreach ($this->value as $jira_key) { if ($this->value) {
$refs[] = id(new DoorkeeperObjectRef()) foreach ($this->value as $jira_key) {
->setApplicationType(DoorkeeperBridgeJIRA::APPTYPE_JIRA) $refs[] = id(new DoorkeeperObjectRef())
->setApplicationDomain($provider->getProviderDomain()) ->setApplicationType(DoorkeeperBridgeJIRA::APPTYPE_JIRA)
->setObjectType(DoorkeeperBridgeJIRA::OBJTYPE_ISSUE) ->setApplicationDomain($provider->getProviderDomain())
->setObjectID($jira_key); ->setObjectType(DoorkeeperBridgeJIRA::OBJTYPE_ISSUE)
->setObjectID($jira_key);
}
} }
return $refs; return $refs;