summaryrefslogtreecommitdiff
path: root/gnucash.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gnucash.cc')
-rw-r--r--gnucash.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gnucash.cc b/gnucash.cc
index e6ef86d0..7912bec2 100644
--- a/gnucash.cc
+++ b/gnucash.cc
@@ -145,7 +145,12 @@ static amount_t convert_number(const std::string& number)
amount_t amt(numer_str);
amount_t den(denom_str);
- return amt / den;
+ if (! den) {
+ have_error = "Denominator in entry is zero!";
+ return amt;
+ } else {
+ return amt / den;
+ }
} else {
return amount_t(number);
}