mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Do something half-way sane (no SIGSEGV) when there are no dives
It just leaves ugly blank areas, but whatever. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
00d798854a
commit
968aa28155
2 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue