Avoid throwing exception when parsing URL in Location constructor