check whether style sheet href exists (fixes #22)

Fixes issue #22: one stylesheet has no href, which breaks the script. Check
whether style sheet href exists, before accessing the .indexOf