From d7cfec90e7e20c950d33389e0a5de152fb60a943 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Sun, 17 Aug 2014 06:51:19 +0930 Subject: [PATCH] ensure env variable exists. Fixes #533 --- nzbToMedia.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nzbToMedia.py b/nzbToMedia.py index c4cef5e2..d4034b36 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -664,14 +664,17 @@ def main(args, section=None): # Check for download_id to pass to CouchPotato download_id = "" + failureLink = None if os.environ.has_key('NZBPR_COUCHPOTATO'): download_id = os.environ['NZBPR_COUCHPOTATO'] + if os.environ.has_key('NZBPR__DNZB_FAILURE'): + failureLink = os.environ['NZBPR__DNZB_FAILURE'] # All checks done, now launching the script. clientAgent = 'nzbget' result = process(os.environ['NZBPP_DIRECTORY'], inputName=os.environ['NZBPP_NZBNAME'], status=status, clientAgent=clientAgent, download_id=download_id, inputCategory=os.environ['NZBPP_CATEGORY'], - failureLink=os.environ['NZBPR__DNZB_FAILURE']) + failureLink=failureLink) # SABnzbd Pre 0.7.17 elif len(args) == nzbtomedia.SABNZB_NO_OF_ARGUMENTS: # SABnzbd argv: