From 8a07e822e69a7ad1297bb98f593604872200afde Mon Sep 17 00:00:00 2001 From: dadav <33197631+dadav@users.noreply.github.com> Date: Tue, 14 Apr 2020 22:20:42 +0200 Subject: [PATCH] breaks if never used --- pwnagotchi/plugins/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pwnagotchi/plugins/__init__.py b/pwnagotchi/plugins/__init__.py index 2ffd21c..08d0b76 100644 --- a/pwnagotchi/plugins/__init__.py +++ b/pwnagotchi/plugins/__init__.py @@ -44,6 +44,8 @@ def toggle_plugin(name, enable=True): global loaded, database if pwnagotchi.config: + if not name in pwnagotchi.config['main']['plugins']: + pwnagotchi.config['main']['plugins'][name] = dict() pwnagotchi.config['main']['plugins'][name]['enabled'] = enable save_config(pwnagotchi.config, '/etc/pwnagotchi/config.toml')