From fd4a2bdb4d8e8dce128a97192f5e990d9c69eb92 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Tue, 8 Nov 2016 10:30:48 -0800 Subject: [PATCH] Make sure agent is in v1 before upgrading agents --- plexpy/notifiers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 16cd67cf..9682259d 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -2901,8 +2901,12 @@ def upgrade_config_to_db(): # Get the old config section for the agent agent_section = section_overrides.get(agent, agent.capitalize()) - agent_config = plexpy.CONFIG._config[agent_section] + agent_config = plexpy.CONFIG._config.get(agent_section) agent_config_key = agent_section.lower() + + # Make sure there is an existing config section (to prevent adding v2 agents) + if not agent_config: + continue # Get all the actions for the agent agent_actions = {}