I'm not very familiar with this code, but...
The problem appears to be that, in the wizard, the application name is initialized to '' (an empty string). If you try to use any application link before a name has been successfully assigned, you'll get this error, since URL() can't create a URL without an application name.
Whoever does the wizard coding might want to disable the new-application links until it has a name.