summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-12-18 22:18:07 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-12-18 22:18:07 +0100
commit7c0849941597490b39118315177d6463a8e65b3d (patch)
tree33ed438ef79e12e9b21748f31e883e21a7f6dee3 /src
parent4b2dc2ab9526ccca3cc6a0a7d85e9236b7ed3582 (diff)
fix segfault when starting without image
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.cxx6
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