fast_charger_brand can be NULL, causes fatal error

Fatal error detected:
`sql: Scan error on column index 18, name "fast_charger_brand": converting NULL to string is unsupported`

Causes ChargeDetail API endpoint to fail. Solution was to add default string value for `fast_charger_brand`
This commit is contained in:
Alec O'Connor
2021-05-03 13:15:51 -04:00
committed by GitHub
parent 381bcb9164
commit ef67d068cc
+1 -1
View File
@@ -223,7 +223,7 @@ func TeslaMateAPICarsChargesDetailsV1(c *gin.Context) {
battery_heater_no_power,
conn_charge_cable,
fast_charger_present,
fast_charger_brand,
COALESCE(fast_charger_brand, '') as fast_charger_brand
fast_charger_type,
outside_temp
FROM charges