rohanmishra29 opened a new pull request, #217:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/217
Fixes #211
## Problem
When the CloudStack management server returns an empty `listapisresponse`
(i.e., `{"listapisresponse":{}}`), the `sync` command panics with:
panic: interface conversion: interface {} is nil, not []interface {}
This happens in `config/cache.go` at the type assertion
`response["api"].([]interface{})` when `response["api"]` is nil.
## Fix
Added a nil check for `response["api"]` before the type assertion. If the
API list is empty, the function now returns `nil` with a clear error message
instead of panicking.
## Testing
Built successfully with `go build ./...`. The nil check prevents the panic
when an empty `listapisresponse` is received.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]