DrBotIRC: only register a function if there's an xmlrpc server loaded

This commit is contained in:
Brian S. Stephan 2012-03-30 17:25:46 -05:00
parent 731aec8c0c
commit 1aa7a542f2
1 changed files with 1 additions and 1 deletions

View File

@ -205,7 +205,7 @@ class DrBotIRC(irclib.IRC):
def xmlrpc_register_function(self, func, name):
"""Add a method to the XML-RPC interface."""
if func:
if func and self.xmlrpc:
if hasattr(func, '__call__'):
self.xmlrpc.register_function(func, name)