-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: DB, SolarQuery
-
None
Got this exception in the logs. The stack reference is to the util/addTo function, where the o object to manipulate is null. Tracing this use back in the calculate_datum_at function, it calls the solarcommon.jsonb_avg function which is what ultimately calls util/addTo. The value passed there as o comes from the initialization of the aggregate:
agg_state = {d:el, c:c};
The el variable is passed into the function, and is what ends up as null. Thus this function should be updated to deal with a null first aggregate value.