Avoid exceptions on empty uri