From kde-commits Mon Apr 30 22:46:11 2012 From: Alvaro Soliverez Date: Mon, 30 Apr 2012 22:46:11 +0000 To: kde-commits Subject: [kmymoney] kmymoney/reports: Make sure a split is selected when constructing the split table of a Message-Id: <20120430224611.0D998A60A9 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133582610210442 Git commit 5cee224d7c23ff6bfaedb9a35b8b88ba82fe5368 by Alvaro Soliverez. Committed on 27/04/2012 at 23:41. Pushed by asoliverez into branch 'master'. Make sure a split is selected when constructing the split table of a report BUG:296723 REVIEW:104765 M +7 -0 kmymoney/reports/querytable.cpp http://commits.kde.org/kmymoney/5cee224d7c23ff6bfaedb9a35b8b88ba82fe5368 diff --git a/kmymoney/reports/querytable.cpp b/kmymoney/reports/querytable.= cpp index 4108144..c418f29 100644 --- a/kmymoney/reports/querytable.cpp +++ b/kmymoney/reports/querytable.cpp @@ -1238,6 +1238,13 @@ void QueryTable::constructSplitsTable(void) loan_special_case =3D splitAcc.isLoan(); } = + // There is a slight chance that at this point myBegin is still pointi= ng to splits.end() if the + // transaction only has income and expense splits (which should not ha= ppen). In that case, point + // it to the first split + if (myBegin =3D=3D splits.end()) { + myBegin =3D splits.begin(); + } + //the account of the beginning splits ReportAccount myBeginAcc =3D (*myBegin).accountId(); =20