diff options
author | Riccardo Albertini <ssirowain@gmail.com> | 2011-09-20 14:44:45 +0200 |
---|---|---|
committer | Riccardo Albertini <ssirowain@gmail.com> | 2011-09-20 14:44:45 +0200 |
commit | 9a853c564c9bb47bc91e74d54d69443eeb4c3449 (patch) | |
tree | 2837c9805025f20c171e896f2dfbdc7c41479d25 | |
parent | e3176882490a012097ae2d158eb8ea0cfb2b5804 (diff) | |
download | subsurface-9a853c564c9bb47bc91e74d54d69443eeb4c3449.tar.gz |
Fix Segmentation fault when trying to print an empty plot.
When printing an empty plot, the function was missing nullability check for 'current_dive'. Now the print of an empty plot results with an empty blank page.
A better solution could be making unsensitive the Print entry in the menu, until a plot is loaded.
Signed-off-by: Riccardo Albertini <ssirowain@gmail.com>
-rw-r--r-- | print.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -22,7 +22,8 @@ static void draw_page(GtkPrintOperation *operation, h = gtk_print_context_get_height(context); /* Do the profile on the top half of the page.. */ - plot(&gc, w, h/2, current_dive); + if (current_dive) + plot(&gc, w, h/2, current_dive); pango_cairo_show_layout(cr,layout); g_object_unref(layout); |