Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
fix for list index out of range when searching
Browse files Browse the repository at this point in the history
  • Loading branch information
evilhero committed Sep 10, 2012
1 parent 9f595ed commit 9386f65
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mylar/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import mylar
from mylar import logger, db, cv
from mylar.helpers import multikeysort, replace_all
from mylar.helpers import multikeysort, replace_all, cleanName

mb_lock = threading.Lock()

Expand Down Expand Up @@ -78,15 +78,17 @@ def findComic(name, mode, issue):
#print ("n: " + str(n) + "--xmcnt" + str(xmlcnt))
if issue is not None: limiter = int(issue)
else: limiter = 0
if int(xmlcnt) > 0 and int(xmlcnt) >= limiter:
if int(xmlcnt) >= limiter:
xmlTag = searched.getElementsByTagName('name')[n].firstChild.wholeText
if (searched.getElementsByTagName('start_year')[n].firstChild) is not None:
xmlYr = searched.getElementsByTagName('start_year')[n].firstChild.wholeText
else: xmlYr = "0000"
xmlurl = searched.getElementsByTagName('site_detail_url')[n].firstChild.wholeText
xmlid = searched.getElementsByTagName('id')[n].firstChild.wholeText
xmlimage = searched.getElementsByTagName('super_url')[n].firstChild.wholeText

if (searched.getElementsByTagName('name')[0].childNodes[0].nodeValue) is None:
xmlimage = searched.getElementsByTagName('super_url')[n].firstChild.wholeText
else:
xmlimage = "cache/blankcover.jpg"
comiclist.append({
'name': xmlTag,
'comicyear': xmlYr,
Expand Down

0 comments on commit 9386f65

Please sign in to comment.