Commit 13af31e
authored
Handle empty response from API listNetworkOfferings (#9)
Fix unhandled error when the response from API listNetworkOfferings is empty and causing TypeError on JS code.
This is to prevent a crash and showing pop up error window — If the API returns a response where listnetworkofferingsresponse has no networkoffering key (which happens when there are zero results — CloudStack omits empty arrays in JSON responses), the value would be undefined. The next line calls .filter() on it, which would throw TypeError: Cannot read properties of undefined (reading 'filter').1 parent 830d976 commit 13af31e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
| 554 | + | |
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| |||
0 commit comments