Fixed checking for "src" attribute, preventing a potential bug if the site ever decides to change its image handling

This commit is contained in:
cryzed
2014-11-01 11:49:36 +01:00
parent d7103969e7
commit 72a5624330
@@ -308,7 +308,7 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
# fix for img urls missing 'http:'
images = soup.findAll('img')
for imagetag in images:
if (not imagetag['src'] is None) and (imagetag['src'].startswith('//')):
if 'src' in imagetag.attrs and imagetag['src'].startswith('//'):
imagetag['src'] = "http:"+imagetag['src']
return self.utf8FromSoup(url,soup)