summaryrefslogtreecommitdiff
path: root/src/pool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/pool.cc')
-rw-r--r--src/pool.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pool.cc b/src/pool.cc
index 0118a97d..d5494352 100644
--- a/src/pool.cc
+++ b/src/pool.cc
@@ -266,6 +266,9 @@ commodity_pool_t::exchange(const amount_t& amount,
amount_t per_unit_cost =
(is_per_unit || amount.is_realzero()) ? cost.abs() : (cost / amount).abs();
+ if (! cost.has_commodity())
+ per_unit_cost.clear_commodity();
+
DEBUG("commodity.prices.add", "exchange: per-unit-cost = " << per_unit_cost);
// Do not record commodity exchanges where amount's commodity has a