bugfix: don't crash (assert), if jumping to the first packet and packet_list is curre...
authorUlf Lamping <ulf.lamping@web.de>
Thu, 15 Sep 2005 23:44:07 +0000 (23:44 -0000)
committerUlf Lamping <ulf.lamping@web.de>
Thu, 15 Sep 2005 23:44:07 +0000 (23:44 -0000)
svn path=/trunk/; revision=15829

gtk/packet_list.c

index dfbffbb6fa681dec48885ffe21ccf65fe91f4281..be35221454ad9b80a4e3e502b2d30d0692247821 100644 (file)
@@ -824,6 +824,12 @@ packet_list_set_selected_row(gint row)
 
         eth_clist_moveto(ETH_CLIST(packet_list), row, -1, 0.0, 0.0);
 
+               /* even after move still invisible (happens with empty list) -> give up */
+               if(eth_clist_row_is_visible(ETH_CLIST(packet_list), row) ==
+                       GTK_VISIBILITY_FULL) {
+                       return;
+               }
+
                /* The now selected row will be the first visible row in the list.
                 * This is inconvenient, as the user is usually interested in some 
                 * packets *before* the currently selected one too.