From f97bd593af145864b73bc60f3fd0b972c895c3fe Mon Sep 17 00:00:00 2001 From: Nemunaire Date: Tue, 27 May 2014 16:06:47 +0200 Subject: [PATCH] Fix bug when no module configuration is present --- modules/networking.py | 2 +- modules/weather.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/networking.py b/modules/networking.py index 6557a03..a6ae68d 100644 --- a/modules/networking.py +++ b/modules/networking.py @@ -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" "\nRegister at " diff --git a/modules/weather.py b/modules/weather.py index d902958..ca0f236 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -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\nRegister at "