🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Should not break on empty database
Deluande94fe3ef26e
diff --git a/persistence/base_repository.go b/persistence/base_repository.goindex 20c25c478..519820459 100644--- a/persistence/base_repository.go+++ b/persistence/base_repository.go@@ -110,11 +110,13 @@ func (r *baseRepository) readEntity(id string) (interface{}, error) {func (r *baseRepository) toEntity(response [][]byte, entity interface{}) error {var record = make(map[string]interface{}, len(response))for i, v := range response {- var value interface{}- if err := json.Unmarshal(v, &value); err != nil {- return err+ if len(v) > 0 {+ var value interface{}+ if err := json.Unmarshal(v, &value); err != nil {+ return err+ }+ record[string(r.fieldNames[i])] = value}- record[string(r.fieldNames[i])] = value}return utils.ToStruct(record, entity)