? bug127462.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gossip/ChangeLog,v
retrieving revision 1.222
diff -u -p -r1.222 ChangeLog
--- ChangeLog	12 Dec 2003 13:18:40 -0000	1.222
+++ ChangeLog	13 Dec 2003 09:11:45 -0000
@@ -1,3 +1,8 @@
+2003-12-13  Martyn Russell  <ginxd@btopenworld.com>
+
+	* src/gossip-app.c (app_complete_jid_response_cb): added fix for
+	bug 127462 reported by Ralph Meijer.
+
 2003-12-12  Geert-Jan Van den Bogaerde  <gvdbogaerde@pandora.be>
 
 	* src/gossip-chat-window.h:
Index: src/gossip-app.c
===================================================================
RCS file: /cvs/gnome/gossip/src/gossip-app.c,v
retrieving revision 1.69
diff -u -p -r1.69 gossip-app.c
--- src/gossip-app.c	11 Dec 2003 10:10:09 -0000	1.69
+++ src/gossip-app.c	13 Dec 2003 09:11:48 -0000
@@ -1508,14 +1508,25 @@ app_complete_jid_response_cb (GtkWidget 
 	GList       *l;
 
 	if (response == GTK_RESPONSE_OK) {
-		GossipRosterItem *item;
+		GossipRosterItem *item = NULL;
 		str = gtk_entry_get_text (GTK_ENTRY (data->entry));
 		if (gossip_jid_string_is_valid_jid (str)) {
 			jid = gossip_jid_new (str);
+
+
 			item = gossip_roster_get_item (gossip_app_get_roster (), jid);
-			chat = gossip_chat_get_for_item (item);
-			gossip_chat_present (chat);
-			gossip_jid_unref (jid);
+			if (!item) {
+				item = gossip_roster_item_new (jid);
+			}
+
+			if(item) {
+				chat = gossip_chat_get_for_item (item);
+				
+				gossip_chat_present (chat);
+				gossip_jid_unref (jid);
+			} else {
+				g_warning ("could not create roster item for JID '%s'", str); 
+			}
 		} else {
 			/* FIXME: Display error dialog... */
 			g_warning ("'%s' is not a valid JID.", str);
