ERROR: TypeError: Cannot read property 'watts' of null Detail: undefined() LINE 30: if (o[k] === undefined) { Where: SQL function "calculate_datum_at" statement 1

XMLWordPrintable

    • 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.

            Assignee:
            Matt Magoffin
            Reporter:
            Matt Magoffin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: