Fix crash when NSURL +URLWithString: returns nil (for invalid URLs)