Fixed problems with empty tables, bumped to v4

This commit is contained in:
Magnus Åhall 2024-05-01 21:44:53 +02:00
parent 715ac03c3b
commit 9d2bfc599d
4 changed files with 13 additions and 1 deletions

View File

@ -45,6 +45,10 @@ func AreaRetrieve() (areas []Area, err error) { // {{{
return return
} }
if jsonData == nil {
return
}
err = json.Unmarshal(jsonData, &areas) err = json.Unmarshal(jsonData, &areas)
if err != nil { if err != nil {
err = re.Wrap(err) err = re.Wrap(err)

View File

@ -23,7 +23,7 @@ import (
"time" "time"
) )
const VERSION = "v3" const VERSION = "v4"
var ( var (
logger *slog.Logger logger *slog.Logger

View File

@ -55,6 +55,10 @@ func ProblemsRetrieve() (problems []Problem, err error) {
return return
} }
if jsonBody == nil {
return
}
err = json.Unmarshal(jsonBody, &problems) err = json.Unmarshal(jsonBody, &problems)
if err != nil { if err != nil {
err = we.Wrap(err) err = we.Wrap(err)

View File

@ -63,6 +63,10 @@ func TriggersRetrieve() (areas []Area, err error) { // {{{
return return
} }
if jsonData == nil {
return
}
err = json.Unmarshal(jsonData, &areas) err = json.Unmarshal(jsonData, &areas)
if err != nil { if err != nil {
err = we.Wrap(err) err = we.Wrap(err)