Harden the code: if regular URL creation fails for any reason, do not attempt to create a file URL.