Skip to content

Commit 0dd821d

Browse files
Fix : Index out of bound error for get experiments command (#290)
Signed-off-by: Sarthak Jain <[email protected]>
1 parent 7fdbb3f commit 0dd821d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cmd/get/experiments.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ var experimentsCmd = &cobra.Command{
106106
if end > totalExperiments {
107107
end = totalExperiments
108108
}
109+
// check if there are no more experiments to display
110+
if start >= totalExperiments {
111+
utils.Red.Println("No more experiments to display")
112+
break
113+
}
114+
109115
writer := tabwriter.NewWriter(os.Stdout, 4, 8, 1, '\t', 0)
110116
utils.White_B.Fprintln(writer, "CHAOS EXPERIMENT ID\tCHAOS EXPERIMENT NAME\tCHAOS EXPERIMENT TYPE\tNEXT SCHEDULE\tCHAOS INFRASTRUCTURE ID\tCHAOS INFRASTRUCTURE NAME\tLAST UPDATED By")
111117

0 commit comments

Comments
 (0)