Fix panic when opening an invalid URL (#42483)

Now instead of a panic we see this:

<img width="511" height="132" alt="Screenshot 2025-11-11 at 3 47 25 PM"
src="https://github.com/user-attachments/assets/48ba2f41-c5c0-4030-9331-0d3acfbf9461"
/>


Release Notes:

- Trying to open invalid URLs in a browser now shows an error instead of
panicking
a56693d9e8Richard Feldman committed on 11/11/2025, 9:24:37 PM· committed by GitHubparentb4b7a23
2 files changedLine totals unavailable