From 0ae16899defc383eaedacf20f5ba03719d1e9322 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 10 Dec 2012 11:02:33 -0800 Subject: Don't draw tooltips if no profile is displayed This fixes ticket 33 Signed-off-by: Dirk Hohndel --- profile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'profile.c') diff --git a/profile.c b/profile.c index 4b02f9bc1..f8b4bd168 100644 --- a/profile.c +++ b/profile.c @@ -2120,7 +2120,7 @@ void get_plot_details(struct graphics_context *gc, int time, char *buf, size_t b { struct plot_info *pi = &gc->pi; int pressure = 0, temp = 0; - struct plot_data *entry; + struct plot_data *entry = NULL; int i; for (i = 0; i < pi->nr; i++) { @@ -2132,5 +2132,6 @@ void get_plot_details(struct graphics_context *gc, int time, char *buf, size_t b if (entry->sec >= time) break; } - plot_string(entry, buf, bufsize, entry->depth, pressure, temp, pi->has_ndl); + if (entry) + plot_string(entry, buf, bufsize, entry->depth, pressure, temp, pi->has_ndl); } -- cgit v1.2.3-70-g09d2