Title: Fix nil panic in UpdateCache when listapisresponse is empty (#211) by rohanmishra29 · Pull Request #217 · apache/cloudstack-cloudmonkey · GitHub
Open Graph Title: Fix nil panic in UpdateCache when listapisresponse is empty (#211) by rohanmishra29 · Pull Request #217 · apache/cloudstack-cloudmonkey
X Title: Fix nil panic in UpdateCache when listapisresponse is empty (#211) by rohanmishra29 · Pull Request #217 · apache/cloudstack-cloudmonkey
Description: 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.
Open Graph Description: Fixes #211 Problem When the CloudStack management server returns an empty listapisresponse (i.e., {"listapisresponse":{}}), the sync command panics with: panic: interface conversion: inte...
X Description: Fixes #211 Problem When the CloudStack management server returns an empty listapisresponse (i.e., {"listapisresponse":{}}), the sync command panics with: panic: interface conversi...
Opengraph URL: https://github.com/apache/cloudstack-cloudmonkey/pull/217
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:08a2bbea-b562-522e-dd07-fe97ea1164a6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 952A:141FAF:1FCF70E:2BBB9D3:6A4EC5A5 |
| html-safe-nonce | d2172768eab4138aa538b60d90b4fbb059c32cbf5ef578c910243c5020876be8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTJBOjE0MUZBRjoxRkNGNzBFOjJCQkI5RDM6NkE0RUM1QTUiLCJ2aXNpdG9yX2lkIjoiNzg5MDg3Mjk5OTI4ODQyMzg0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a121a8b1180df46d04fe3eacdb318f73a36f3ffe4b2c30ae0a579d6288aff1b8 |
| hovercard-subject-tag | pull_request:4005336424 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/apache/cloudstack-cloudmonkey/pull/217/files |
| twitter:image | https://avatars.githubusercontent.com/u/194393070?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/194393070?s=400&v=4 |
| og:image:alt | Fixes #211 Problem When the CloudStack management server returns an empty listapisresponse (i.e., {"listapisresponse":{}}), the sync command panics with: panic: interface conversion: inte... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/apache/cloudstack-cloudmonkey git https://github.com/apache/cloudstack-cloudmonkey.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 13641478 |
| octolytics-dimension-repository_nwo | apache/cloudstack-cloudmonkey |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 13641478 |
| octolytics-dimension-repository_network_root_nwo | apache/cloudstack-cloudmonkey |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width