aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-09 16:49:10 +0200
committerThomas White <taw@physics.org>2020-09-09 16:49:10 +0200
commit15956a670c5d1a9ddeb5f2b435eae1a7579fd6ed (patch)
tree70fdc982d65d7c7ac27b9abf79d359a0bd1746f4
parent8f859bd6f03a7f8e62563bbf052eb4595a522b9d (diff)
CrystFELImageView: Skip entire draw_sig if image is NULL
-rw-r--r--src/crystfelimageview.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/crystfelimageview.c b/src/crystfelimageview.c
index 997c34d5..3b71f1cd 100644
--- a/src/crystfelimageview.c
+++ b/src/crystfelimageview.c
@@ -497,6 +497,8 @@ static gint draw_sig(GtkWidget *window, cairo_t *cr, CrystFELImageView *iv)
{
cairo_matrix_t m;
+ if ( iv->image == NULL ) return FALSE;
+
cairo_save(cr);
/* Overall background (light grey) */
@@ -512,7 +514,7 @@ static gint draw_sig(GtkWidget *window, cairo_t *cr, CrystFELImageView *iv)
cairo_translate(cr, -gtk_adjustment_get_value(iv->hadj),
gtk_adjustment_get_value(iv->vadj));
- if ( (iv->image != NULL) && (iv->pixbufs != NULL) ) {
+ if ( iv->pixbufs != NULL ) {
int i;
for ( i=0; i<iv->image->detgeom->n_panels; i++ ) {
cairo_save(cr);