--- nautilus-connect-server-dialog.c.old	2009-11-13 23:02:25.006721000 +0100
+++ nautilus-connect-server-dialog.c	2009-11-13 23:05:57.976461669 +0100
@@ -172,6 +172,8 @@
 	GFile *location;
 	int index;
 	GtkTreeIter iter;
+
+	uri = NULL;
 	
 	/* Get our method info */
 	gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->details->type_combo), &iter);
@@ -180,15 +182,6 @@
 	g_assert (index < G_N_ELEMENTS (methods) && index >= 0);
 	meth = &(methods[index]);
 
-	uri = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->server_entry), 0, -1);
-	if (strlen (uri) == 0) {
-		eel_show_error_dialog (_("Cannot Connect to Server. You must enter a name for the server."), 
-				       _("Please enter a name and try again."), 
-				       GTK_WINDOW (dialog));
-		g_free (uri);
-		return;
-	}
-
 	if (meth->scheme == NULL) {
 		uri = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->uri_entry), 0, -1);
 		/* FIXME: we should validate it in some way? */
@@ -197,9 +190,6 @@
 		char *t, *join;
 		gboolean free_initial_path, free_user, free_domain, free_port;
 		
-		server = uri;
-		uri = NULL;
-
 		user = "";
 		port = "";
 		initial_path = "";
@@ -208,6 +198,15 @@
 		free_user = FALSE;
 		free_domain = FALSE;
 		free_port = FALSE;
+
+		server = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->server_entry), 0, -1);
+		if (strlen (server) == 0) {
+			eel_show_error_dialog (_("Cannot Connect to Server. You must enter a name for the server."), 
+					       _("Please enter a name and try again."), 
+					       GTK_WINDOW (dialog));
+			g_free (server);
+			return;
+		}
 		
 		/* FTP special case */
 		if (meth->flags & IS_ANONYMOUS) {
