X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=9d84ff29d64de926983555be28660abcef2786dc;hb=f7fb74f3a78b4fbf561eb91548cf3e355af9b8b1;hp=f898be74580d04e80b03926428df962e8d2f32c5;hpb=ee56021dfbc3bcc12f5917cdf481cc96c51a2b89;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index f898be7..9d84ff2 100644 --- a/profile.c +++ b/profile.c @@ -100,7 +100,7 @@ static void plot(cairo_t *cr, int w, int h, struct dive *dive, int samples, stru static gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data) { - struct dive *dive = dive_table.dives[selected_dive]; + struct dive *dive = current_dive; cairo_t *cr; int w,h; @@ -111,7 +111,7 @@ static gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer cairo_set_source_rgb(cr, 0, 0, 0); cairo_paint(cr); - if (dive->samples) + if (dive && dive->samples) plot(cr, w, h, dive, dive->samples, dive->sample); cairo_destroy(cr);