mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Return zero instead of failing an assertion when the register asks a
Split for its amount in a commodity that is not involved in the split's transaction. This will prevent the crash in bug #379625, but doesn't solve the underlying problem, which is a bug in the register. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15179 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
+6
-3
@@ -1068,9 +1068,12 @@ xaccSplitConvertAmount (const Split *split, Account * account)
|
||||
const Split *osplit = xaccSplitGetOtherSplit (split);
|
||||
|
||||
if (osplit)
|
||||
g_assert(gnc_commodity_equal(
|
||||
to_commodity,
|
||||
xaccAccountGetCommodity(xaccSplitGetAccount(osplit))));
|
||||
if (!gnc_commodity_equal(
|
||||
to_commodity,
|
||||
xaccAccountGetCommodity(xaccSplitGetAccount(osplit)))) {
|
||||
PERR("The split's amount can't be converted into this commodity.");
|
||||
return gnc_numeric_zero();
|
||||
}
|
||||
if (osplit)
|
||||
return gnc_numeric_neg (xaccSplitGetAmount (osplit));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user