Changed by Shark to support origin file:// & null