Bug fix: don't crash when a document has an invalid url.