fixed crash (with no error code) when no section. fixes #390

This commit is contained in:
clinton-hall 2014-05-14 17:21:28 +09:30
parent f627ddec9b
commit ade9e60a8b
2 changed files with 12 additions and 0 deletions

View file

@ -39,6 +39,12 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
# auto-detect section
section = nzbtomedia.CFG.findsection(inputCategory).isenabled()
if section is None:
logger.error(
'Category:[%s] is not defined or is not enabled. Please rename it or ensure it is enabled for teh appropriate section in your autoProcessMedia.cfg and try again.' % (
inputCategory))
return -1
if len(section) > 1:
logger.error(
'Category:[%s] is not unique, %s are using it. Please rename it or disable all other sections using the same category name in your autoProcessMedia.cfg and try again.' % (