Check for the href attribute before trying to split it.
[Fixes #86]