1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +01:00

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
This commit is contained in:
Bob Trahan 2012-05-17 14:55:18 -07:00
parent 60696de095
commit 5475a1bec7

View file

@ -39,7 +39,10 @@ final class PhabricatorIRCMacroHandler extends PhabricatorIRCHandler {
$macros = $this->getConduit()->callMethodSynchronous( $macros = $this->getConduit()->callMethodSynchronous(
'macro.query', 'macro.query',
array()); array());
// gotta bail if we failed to fetch the macros
if ($macros === null) {
return false;
}
$this->macros = $macros; $this->macros = $macros;
$regexp = array(); $regexp = array();