Fix json#Unmarshal when there are no servers
This commit is contained in:
parent
1f4aca8210
commit
814914ca19
|
@ -63,8 +63,11 @@ func (r *PanelRequest) GetAllServerConfigurations() (map[string]*ServerConfigura
|
|||
return nil, r.Error(), nil
|
||||
}
|
||||
|
||||
res := map[string]*ServerConfigurationResponse{}
|
||||
b, _ := r.ReadBody()
|
||||
res := map[string]*ServerConfigurationResponse{}
|
||||
if len(b) == 2 {
|
||||
return res, nil, nil
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(b, &res); err != nil {
|
||||
return nil, nil, errors.WithStack(err)
|
||||
|
|
Loading…
Reference in New Issue
Block a user