From 8798d2189efcd2e2d183f0422cd43403cf614d8b Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 11 Oct 2012 15:00:25 -0700 Subject: [PATCH] Prevent notice for missing configuration in PhabricatorIRCDifferentialNotificationHandler Summary: Provide array() default so we don't foreach() over null in the case of a missing config (from @dctrwatson). Test Plan: Will verify with @dctrwatson. Reviewers: vrana, btrahan, dctrwatson Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D3686 --- .../handler/PhabricatorIRCDifferentialNotificationHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/daemon/irc/handler/PhabricatorIRCDifferentialNotificationHandler.php b/src/infrastructure/daemon/irc/handler/PhabricatorIRCDifferentialNotificationHandler.php index e26fef8385..387159f88b 100644 --- a/src/infrastructure/daemon/irc/handler/PhabricatorIRCDifferentialNotificationHandler.php +++ b/src/infrastructure/daemon/irc/handler/PhabricatorIRCDifferentialNotificationHandler.php @@ -57,7 +57,8 @@ final class PhabricatorIRCDifferentialNotificationHandler $actor_name = $handles[$actor_phid]->getName(); $message = "{$actor_name} {$verb} revision D".$data['revision_id']."."; - foreach ($this->getConfig('notification.channels') as $channel) { + $channels = $this->getConfig('notification.channels', array()); + foreach ($channels as $channel) { $this->write('PRIVMSG', "{$channel} :{$message}"); } }