diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-18 22:18:07 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-18 22:18:07 +0100 |
commit | 7c0849941597490b39118315177d6463a8e65b3d (patch) | |
tree | 33ed438ef79e12e9b21748f31e883e21a7f6dee3 /src | |
parent | 4b2dc2ab9526ccca3cc6a0a7d85e9236b7ed3582 (diff) |
fix segfault when starting without image
Diffstat (limited to 'src')
-rw-r--r-- | src/GipfelWidget.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index e80d94c..591e4eb 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -521,7 +521,11 @@ GipfelWidget::get_tilt_angle() { double GipfelWidget::get_focal_length_35mm() { - return pan->get_scale() * 35.0 / (double) img->w(); + if (img == NULL) { + return NAN; + } else { + return pan->get_scale() * 35.0 / (double) img->w(); + } } double |