Added NPE check to prevent a crash when certain config options are unused.