gfio: fix crash when pushing 'start job' and no client connected
authorJens Axboe <axboe@kernel.dk>
Mon, 12 Mar 2012 22:05:29 +0000 (23:05 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Mar 2012 22:05:29 +0000 (23:05 +0100)
We should not really need this fix, but until the menu item
sensitivity is fixed, they are visible and we should avoid
the crash.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
gfio.c

diff --git a/gfio.c b/gfio.c
index ff8763dd07e938285ac51223de88b71d08805b3c..51bac2aa8e864577a5aa35f33aebebdccf1e74e9 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -1738,8 +1738,8 @@ static void start_job_clicked(__attribute__((unused)) GtkWidget *widget,
        struct gui_entry *ge = data;
        struct gfio_client *gc = ge->client;
 
-       gtk_widget_set_sensitive(ge->button[START_JOB_BUTTON], 0);
-       fio_start_client(gc->client);
+       if (gc)
+               fio_start_client(gc->client);
 }
 
 static void file_open(GtkWidget *w, gpointer data);