migtools / mig-ui

Openshift Migration UI
Apache License 2.0
10 stars 31 forks source link

Bug 2082221: Fix possible console error exposed by #1420 when plan status is undefined #1422

Closed mturley closed 2 years ago

mturley commented 2 years ago

In certain conditions, the wizard renders with the status field undefined on the current migplan. Changes introduced by #1420 attempt to read status.destStorageClasses, potentially resulting in a "Cannot read property destStorageClasses of undefined" error. This was not caught by TypeScript due to loose type definitions. This PR adds an additional ? to the optional chaining such that the list of storage classes will default to empty if the status of the plan is undefined.

This should be backported as part of the fix for https://bugzilla.redhat.com/show_bug.cgi?id=2082221.