diff --git a/amount.cc b/amount.cc index 8771e944..729d12f5 100644 --- a/amount.cc +++ b/amount.cc @@ -408,7 +408,7 @@ amount_t& amount_t::operator*=(const amount_t& amt) amount_t& amount_t::operator/=(const amount_t& amt) { - if (! amt.quantity) + if (! amt.quantity || ! amt) throw amount_error("Divide by zero"); else if (! quantity) return *this;