When generating Statement of Changes in Equity reports, using cash basis, the following exception occurs:
System.NullReferenceException: Object reference not set to an instance of an object.
at ManagerServer.HttpHandlers.Businesses.Business.Reports.StatementOfChangesInEquity.StatementOfChangesInEquityView.<>c.b__6_15(GeneralLedgerTransaction x) in /Users/runner/work/Manager/Manager/ManagerServer/HttpHandlers/Businesses/Business/Reports/FinancialStatements/StatementOfChangesInEquity/StatementOfChangesInEquityView.cs:line 74
at System.Linq.Lookup`2.Create(IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
at System.Linq.GroupedEnumerable`2.ToArray()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()
at ManagerServer.HttpHandlers.Businesses.Business.Reports.StatementOfChangesInEquity.StatementOfChangesInEquityView.GetViewModel(StatementOfChangesInEquity report) in /Users/runner/work/Manager/Manager/ManagerServer/HttpHandlers/Businesses/Business/Reports/FinancialStatements/StatementOfChangesInEquity/StatementOfChangesInEquityView.cs:line 74
at ManagerServer.HttpHandlers.Businesses.Business.Reports.Report2`1.GetViewModel() in /Users/runner/work/Manager/Manager/ManagerServer/HttpHandlers/Businesses/Business/Reports/Report2.cs:line 806
at ManagerServer.HttpHandlers.Businesses.Business.Reports.Report2.InnerGet2() in /Users/runner/work/Manager/Manager/ManagerServer/HttpHandlers/Businesses/Business/Reports/Report2.cs:line 42
at ManagerServer.HttpHandlers.Businesses.Business.BusinessTemplate.InnerGet() in /Users/runner/work/Manager/Manager/ManagerServer/HttpHandlers/Businesses/Business/BusinessTemplate.cs:line 304
at ManagerServer.HttpHandlers.Template.Get() in /Users/runner/work/Manager/Manager/ManagerServer/HttpHandlers/Template.cs:line 333
at ManagerServer.Startup.<>c.<b__1_3>d.MoveNext() in /Users/runner/work/Manager/Manager/ManagerServer/Startup.cs:line 105
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
The exception does not occur if changing the accounting basis to Accrual, for the same period (however this is not a solution as the business uses cash basis).
However, not all accounting periods are affected, as there are three years from the start of the business (2014-15, 2015-16 and 2016-17) for which the Change of Equity report works fine in cash basis. Reports for all years from 2017 onwards produce the exception, when using cash basis, including the current financial year 2024-25.
The business has always been set up as cash basis in Manager (i.e. there was no change to the accounting method in 2017, that could have caused this). It’s also worth noting that the Change of Equity report used to work correctly for all of the affected years but at some point (unknown) the report has started triggering the exception.
Other financial statement reports (e.g. Profit and Loss, Balance Sheet) work correctly for the same periods, using cash basis, as the non-working Change of Equity reports.
It is possible that the bug has been present for a while, as the Change of Equity report isn’t something I use on a regular basis, so it could have been introduced in an earlier version of Manager or as a result of data that has been changed at some point over the past few months (e.g. deleting or editing entries) but it hasn’t been picked up until the running the reports today.
Desktop Edition
Manager version: 24.9.9.1845
OS version: MacOS Sonoma 14.6.1
(the bug occurs in the previous version of Manager I used too, 24.8.30.1831, so it’s not something new to the latest version)
Any help greatly appreciated!