summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/commodity.cc')
-rw-r--r--src/commodity.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/commodity.cc b/src/commodity.cc
index a01847c5..5e55db31 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -96,7 +96,9 @@ commodity_t::find_price(const optional<commodity_t&>& commodity,
target = *pool().default_commodity;
optional<price_point_t> point =
- pool().commodity_price_history.find_price(*this, when, oldest, target);
+ target ?
+ pool().commodity_price_history.find_price(*this, *target, when, oldest) :
+ pool().commodity_price_history.find_price(*this, when, oldest);
if (pair) {
if (base->price_map.size() > base_t::max_price_map_size) {