From 6861b9915e9c15e009e1218e065c3f24b1814101 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Mon, 13 Jan 2020 20:40:46 +1300 Subject: [PATCH] fix empty dir_name #1673 (#1700) --- core/auto_process/tv.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/auto_process/tv.py b/core/auto_process/tv.py index 4c6edfac..801f3234 100644 --- a/core/auto_process/tv.py +++ b/core/auto_process/tv.py @@ -95,12 +95,13 @@ def process(section, dir_name, input_name=None, failed=False, client_agent='manu # Attempt to create the directory if it doesn't exist and ignore any # error stating that it already exists. This fixes a bug where SickRage # won't process the directory because it doesn't exist. - try: - os.makedirs(dir_name) # Attempt to create the directory - except OSError as e: - # Re-raise the error if it wasn't about the directory not existing - if e.errno != errno.EEXIST: - raise + if dir_name: + try: + os.makedirs(dir_name) # Attempt to create the directory + except OSError as e: + # Re-raise the error if it wasn't about the directory not existing + if e.errno != errno.EEXIST: + raise if 'process_method' not in fork_params or (client_agent in ['nzbget', 'sabnzbd'] and nzb_extraction_by != 'Destination'): if input_name: