Ignore attempts to annotate the null commodity

Fixes 04C5E1CA-1B39-4214-81C7-FD5AA785308F
This commit is contained in:
John Wiegley 2009-06-15 17:01:55 +01:00
parent c9719006be
commit d45b35798c

View file

@ -740,7 +740,7 @@ void amount_t::annotate(const annotation_t& details)
if (! quantity)
throw_(amount_error, _("Cannot annotate the commodity of an uninitialized amount"));
else if (! has_commodity())
throw_(amount_error, _("Cannot annotate an amount with no commodity"));
return; // ignore attempt to annotate a "bare commodity
if (commodity().annotated) {
this_ann = &as_annotated_commodity(commodity());