axitkhurana / buster

Brute force static site generator for Ghost
MIT License
802 stars 139 forks source link

prevent fixLinks error when href is NoneType object #42

Closed coldnew closed 9 years ago

coldnew commented 9 years ago

This commit prevent href is NonType object when execute fixLinks function, the error info like following:

fixing links in /media/build/Workspace/blog/static/shi-yong-shairport-rang-ni-de-raspberry-pi-bian-cheng-airplay-yin-le-bo-fang-qi/index.html ../index.html => ../ ../rss/index.html => ../rss/index.rss Traceback (most recent call last): File "/home/coldnew/.local/bin/buster", line 9, in load_entry_point('buster==0.1.3', 'console_scripts', 'buster')() File "/home/coldnew/.local/lib64/python2.7/site-packages/buster/buster.py", line 91, in main newtext = fixLinks(filetext, parser) File "/home/coldnew/.local/lib64/python2.7/site-packages/buster/buster.py", line 69, in fixLinks if not abs_url_regex.search(href): TypeError: expected string or buffer

coldnew commented 9 years ago

This commit will make fixLinks function can't really work in rss feed, I'll rewrite new patch close