Don't crash on prompt cancel.

If the user hits "Cancel" then `window.prompt()` will return `null`.  As-is, the code crashes when that happens (trying to call `null.replace(...)`).