Skip to content

Commit 2dca95c

Browse files
committed
Fix nil panic in UpdateCache when listapisresponse is empty (#211)
1 parent 76df16c commit 2dca95c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

config/cache.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ func (c *Config) UpdateCache(response map[string]interface{}) interface{} {
112112
apiVerbMap = nil
113113

114114
count := response["count"]
115+
if response["api"] == nil {
116+
fmt.Println("Error: empty API list received, sync failed")
117+
return nil
118+
}
115119
apiList := response["api"].([]interface{})
116120

117121
for _, node := range apiList {

0 commit comments

Comments
 (0)