Skip to content

Commit

Permalink
Merge pull request #1309 from yaacov/status-vm-may-be-empty
Browse files Browse the repository at this point in the history
props.resourceData.statusVM may be null
  • Loading branch information
yaacov authored Aug 18, 2024
2 parents 509aa55 + eb773f3 commit 98773d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const cellRenderers: Record<string, React.FC<PlanVMsCellProps>> = {
);
},
status: (props: PlanVMsCellProps) => {
const pipeline = props.data.statusVM?.pipeline;
const pipeline = props.data.statusVM?.pipeline || [];
let lastRunningItem: V1beta1PlanStatusMigrationVmsPipeline;

if (pipeline[0]?.phase === 'Pending') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export const MigrationVirtualMachinesRowExtended: React.FC<RowProps<VMData>> = (
const { t } = useForkliftTranslation();
const { showModal } = useModal();

const pipeline = props.resourceData.statusVM?.pipeline;
const conditions = props.resourceData.statusVM?.conditions;
const pipeline = props.resourceData.statusVM?.pipeline || [];
const conditions = props.resourceData.statusVM?.conditions || [];
const pods = props.resourceData.pods;
const jobs = props.resourceData.jobs;
const pvcs = props.resourceData.pvcs;
Expand Down Expand Up @@ -238,7 +238,7 @@ export const MigrationVirtualMachinesRowExtended: React.FC<RowProps<VMData>> = (
</>
)}

{(conditions || []).length > 0 && (
{conditions.length > 0 && (
<>
<SectionHeading
text={'Conditions'}
Expand All @@ -255,7 +255,7 @@ export const MigrationVirtualMachinesRowExtended: React.FC<RowProps<VMData>> = (
</Tr>
</Thead>
<Tbody>
{(conditions || []).map((condition) => (
{conditions.map((condition) => (
<Tr key={condition.type}>
<Td>{condition.type}</Td>
<Td>{getStatusLabel(condition.status)}</Td>
Expand Down

0 comments on commit 98773d6

Please sign in to comment.