Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Stack Monitoring] Add default value for source and target to prevent…
… runtime error (elastic#180043) ## 📓 Summary The issue occurs because when requesting from the server the details about elasticsearch for the cluster (`POST /api/monitoring/v1/clusters/{clusterUuid}/elasticsearch`), it includes a list of shard activities in the response. Items of this `shardActivity` ([ElasticsearchIndexRecoveryShard](https://github.com/elastic/kibana/blob/main/x-pack/plugins/monitoring/common/types/es.ts#L380)) may have an **optional** `source` property, but once the data reaches the client app, the current implementation gives for granted this value will always exist, and when accessing specific properties of `source`, this generates a runtime error, resulting in a blank screen. This change uses a default empty `source` and `target` object on the client to prevent a reference error when accessing their properties and set them to undefined. --------- Co-authored-by: Marco Antonio Ghiani <[email protected]>
- Loading branch information