frontlib: Fix onRoomUpdateCb receiving a null pointer
authorMedo <smaxein@googlemail.com>
Wed, 18 Jul 2012 21:34:49 +0200
changeset 7336 f821f7d727b7
parent 7334 66a10ae88457
child 7338 1ed603a54ebd
frontlib: Fix onRoomUpdateCb receiving a null pointer
project_files/frontlib/net/netconn.c
--- a/project_files/frontlib/net/netconn.c	Tue Jul 17 23:06:20 2012 +0200
+++ b/project_files/frontlib/net/netconn.c	Wed Jul 18 21:34:49 2012 +0200
@@ -404,10 +404,11 @@
 	    			conn->onRoomAddCb(conn->onRoomAddCtx, conn->roomList.rooms[0]);
 	    		}
 			} else if(!strcmp(subcmd, "UPD") && netmsg->partCount == 11) {
+				char *newName = netmsg->parts[4];
 	    		if(flib_roomlist_update(&conn->roomList, netmsg->parts[2], netmsg->parts+3)) {
 	    			flib_log_e("Error updating room in list");
 	    		} else {
-	    			conn->onRoomUpdateCb(conn->onRoomUpdateCtx, netmsg->parts[2], flib_roomlist_find(&conn->roomList, netmsg->parts[2]));
+	    			conn->onRoomUpdateCb(conn->onRoomUpdateCtx, netmsg->parts[2], flib_roomlist_find(&conn->roomList, newName));
 	    		}
 			} else if(!strcmp(subcmd, "DEL") && netmsg->partCount == 3) {
 	    		if(flib_roomlist_delete(&conn->roomList, netmsg->parts[2])) {