Page MenuHomeDevCentral

If an array parameter is missing in ItemGroupMapping, populate [] or throw a clear exception
Closed, ResolvedPublic

Description

[2017-04-09 01:51:32] production.ERROR: ErrorException: Invalid argument supplied for foreach() in /var/wwwroot/default/app/Analyzers/ItemGroupMapping.php:51
Stack trace:
#1 /var/wwwroot/default/app/Analyzers/Phabricator/PhabricatorPayloadAnalyzer.php(57): Nasqueron\Notifications\Analyzers\ItemGroupMapping->doesItemBelong('easy'
)
#2 /var/wwwroot/default/app/Notifications/PhabricatorNotification.php(55): Nasqueron\Notifications\Analyzers\Phabricator\PhabricatorPayloadAnalyzer->getGroup()
#3 /var/wwwroot/default/app/Notifications/PhabricatorNotification.php(30): Nasqueron\Notifications\Notifications\PhabricatorNotification->getGroup()
#4 /var/wwwroot/default/app/Jobs/FirePhabricatorNotification.php(49): Nasqueron\Notifications\Notifications\PhabricatorNotification->__construct('Nasqueron', O
bject(Nasqueron\Notifications\Phabricator\PhabricatorStory))
#5 /var/wwwroot/default/app/Jobs/FirePhabricatorNotification.php(36): Nasqueron\Notifications\Jobs\FirePhabricatorNotification->createNotification()

Event Timeline

T1177 offers some validation, this exception is present when the items keyt isn't defined. to add items: [], solves the issue.

We should raise a custom exception in such situation.

dereckson renamed this task from Invalid argument supplied for foreach() in ItemGroupMapping to If an array parameter is missing in ItemGroupMapping, populate [] or throw a clear exception.Apr 9 2017, 10:25
dereckson removed dereckson as the assignee of this task.
dereckson lowered the priority of this task from High to Low.
dereckson raised the priority of this task from Low to Normal.

This is a case we can [] by default, okay taking this bug.