If there aren't any packets to select, don't try to select the first
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 25 Jan 2000 00:36:35 +0000 (00:36 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 25 Jan 2000 00:36:35 +0000 (00:36 +0000)
packet; "select_packet()" gets peeved because it can't find the packet,
and panics.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1547 f5534014-38df-0310-8fa8-9805f1628bb7

file.c

diff --git a/file.c b/file.c
index aa6291ffa2fae261c75282f688b40fb0e7dc589a..4122bc0cad3796036ceed850e2da7c463a83d56a 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
 /* file.c
  * File I/O routines
  *
- * $Id: file.c,v 1.156 2000/01/25 00:17:00 guy Exp $
+ * $Id: file.c,v 1.157 2000/01/25 00:36:35 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -326,8 +326,10 @@ read_cap_file(capture_file *cf)
   /* Enable menu items that make sense if you have some captured packets. */
   set_menus_for_captured_packets(TRUE);
 
-  /* Make the first row the selected row. */
-  gtk_signal_emit_by_name(GTK_OBJECT(packet_list), "select_row", 0);
+  /* If we have any packets to select, select the first packet by making
+     the first row the selected row. */
+  if (cf->plist != NULL)
+    gtk_signal_emit_by_name(GTK_OBJECT(packet_list), "select_row", 0);
 
   if (!success) {
     /* Put up a message box noting that the read failed somewhere along