Skip to content

Commit

Permalink
Merge pull request #105 from ralphbean/handle-null-items
Browse files Browse the repository at this point in the history
fix: handle null items response
  • Loading branch information
sahil143 authored Feb 10, 2025
2 parents 1d178fc + e46cad5 commit 591f649
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/k8s/k8s-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ export const k8sListResource = <TResource extends K8sResourceCommon>({
true,
).then((result) => ({
...result,
items: result.items.map((i) => ({
...i,
apiVersion: result.apiVersion,
kind: model.kind,
})),
items: result.items
? result.items.map((i) => ({
...i,
apiVersion: result.apiVersion,
kind: model.kind,
}))
: [],
}));

export const K8sListResourceItems = <TResource extends K8sResourceCommon>(
Expand Down

0 comments on commit 591f649

Please sign in to comment.