Fix bug when no module configuration is present
This commit is contained in:
parent
f8dbb7d2e1
commit
f97bd593af
@ -13,7 +13,7 @@ nemubotversion = 3.3
|
||||
def load(context):
|
||||
from hooks import Hook
|
||||
|
||||
if not CONF.hasNode("whoisxmlapi") or not CONF.getNode("whoisxmlapi").hasAttribute("username") or not CONF.getNode("whoisxmlapi").hasAttribute("password"):
|
||||
if not CONF or not CONF.hasNode("whoisxmlapi") or not CONF.getNode("whoisxmlapi").hasAttribute("username") or not CONF.getNode("whoisxmlapi").hasAttribute("password"):
|
||||
print ("You need a WhoisXML API account in order to use the "
|
||||
"!netwhois feature. Add it to the module configuration file:\n"
|
||||
"<whoisxmlapi username=\"XX\" password=\"XXX\" />\nRegister at "
|
||||
|
@ -12,7 +12,7 @@ def load(context):
|
||||
global DATAS
|
||||
DATAS.setIndex("name", "city")
|
||||
|
||||
if not CONF.hasNode("darkskyapi") or not CONF.getNode("darkskyapi").hasAttribute("key"):
|
||||
if not CONF or not CONF.hasNode("darkskyapi") or not CONF.getNode("darkskyapi").hasAttribute("key"):
|
||||
print ("You need a Dark-Sky API key in order to use this "
|
||||
"module. Add it to the module configuration file:\n<darkskyapi"
|
||||
" key=\"XXXXXXXXXXXXXXXX\" />\nRegister at "
|
||||
|
Loading…
x
Reference in New Issue
Block a user