From 7c42ade61714317feb1fdc8e67d500e14d12779a Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Sat, 19 May 2012 16:19:33 -0700 Subject: [PATCH] Fix D2490 (make macro handler correctly bail if there are no macros) Summary: D2490 was not my finest hour and I incorrectly thought it was a null value from error. In reality this error is impossible and its just a valid empty array so instead use the empty predicate to bail. Test Plan: with our logic combined, this be tested Reviewers: vrana, epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2503 --- .../daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php b/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php index 78a2d78723..f5008689f0 100644 --- a/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php +++ b/src/infrastructure/daemon/irc/handler/macro/PhabricatorIRCMacroHandler.php @@ -39,8 +39,8 @@ final class PhabricatorIRCMacroHandler extends PhabricatorIRCHandler { $macros = $this->getConduit()->callMethodSynchronous( 'macro.query', array()); - // gotta bail if we failed to fetch the macros - if ($macros === null) { + // bail if we have no macros + if (empty($macros)) { return false; } $this->macros = $macros;