summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/value.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/value.cc b/src/value.cc
index a1316568..54798162 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -857,7 +857,9 @@ bool value_t::is_less_than(const value_t& val) const
case INTEGER:
return as_amount() < val.as_long();
case AMOUNT:
- if (as_amount().commodity() == val.as_amount().commodity())
+ if (as_amount().commodity() == val.as_amount().commodity() ||
+ ! as_amount().has_commodity() ||
+ ! val.as_amount().has_commodity())
return as_amount() < val.as_amount();
else
return commodity_t::compare_by_commodity()(&as_amount(), &val.as_amount());