From 5475a1bec7071fc92d103b621e46b4a471685b1f Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Thu, 17 May 2012 14:55:18 -0700 Subject: [PATCH] IRC Macro Handler - check result from conduit call before operating on it Summary: 'cuz github issue 114 came into existence. instead, just return false early here. note i am not sure if I should phlog that this is happening or not but its not exception worthy IMO. Test Plan: lint-only 'cuz i don't want to setup an IRC server locally / somehow get my local phabricator instance accessible out there. happy to test end to end if there's an easier way...! Reviewers: vrana, epriestley Reviewed By: vrana CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2490 --- .../daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php b/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php index 5c9ba3ce63..78a2d78723 100644 --- a/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php +++ b/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php @@ -39,7 +39,10 @@ final class PhabricatorIRCMacroHandler extends PhabricatorIRCHandler { $macros = $this->getConduit()->callMethodSynchronous( 'macro.query', array()); - + // gotta bail if we failed to fetch the macros + if ($macros === null) { + return false; + } $this->macros = $macros; $regexp = array();