check for keys' existence

This commit is contained in:
Jakob Ketterl 2021-01-16 15:45:33 +01:00
parent ae217f9ded
commit 992a5c33a2

View File

@ -37,11 +37,11 @@ class ReportingEngine(object):
def __init__(self): def __init__(self):
self.reporters = [] self.reporters = []
config = Config.get() config = Config.get()
if config["pskreporter_enabled"]: if "pskreporter_enabled" in config and config["pskreporter_enabled"]:
# inline import due to circular dependencies # inline import due to circular dependencies
from owrx.pskreporter import PskReporter from owrx.pskreporter import PskReporter
self.reporters += [PskReporter()] self.reporters += [PskReporter()]
if config["wsprnet_enabled"]: if "wsprnet_enabled" in config and config["wsprnet_enabled"]:
# inline import due to circular dependencies # inline import due to circular dependencies
from owrx.wsprnet import WsprnetReporter from owrx.wsprnet import WsprnetReporter
self.reporters += [WsprnetReporter()] self.reporters += [WsprnetReporter()]