diff --git a/flytectl/cmd/get/launch_plan.go b/flytectl/cmd/get/launch_plan.go index 34bf10cf1af..f146740bd7e 100644 --- a/flytectl/cmd/get/launch_plan.go +++ b/flytectl/cmd/get/launch_plan.go @@ -128,11 +128,13 @@ func LaunchplanToTableProtoMessages(l []*admin.LaunchPlan) []proto.Message { messages := make([]proto.Message, 0, len(l)) for _, m := range l { m := proto.Clone(m).(*admin.LaunchPlan) - if m.Closure.ExpectedInputs != nil { - printer.FormatParameterDescriptions(m.Closure.ExpectedInputs.Parameters) - } - if m.Closure.ExpectedOutputs != nil { - printer.FormatVariableDescriptions(m.Closure.ExpectedOutputs.Variables) + if m.Closure != nil { + if m.Closure.ExpectedInputs != nil { + printer.FormatParameterDescriptions(m.Closure.ExpectedInputs.Parameters) + } + if m.Closure.ExpectedOutputs != nil { + printer.FormatVariableDescriptions(m.Closure.ExpectedOutputs.Variables) + } } messages = append(messages, m) } diff --git a/flytectl/cmd/get/task.go b/flytectl/cmd/get/task.go index 9f9a7b9861b..a9f0859d58c 100644 --- a/flytectl/cmd/get/task.go +++ b/flytectl/cmd/get/task.go @@ -116,11 +116,17 @@ func TaskToTableProtoMessages(l []*admin.Task) []proto.Message { messages := make([]proto.Message, 0, len(l)) for _, m := range l { m := proto.Clone(m).(*admin.Task) - if m.Closure.CompiledTask.Template.Interface.Inputs != nil { - printer.FormatVariableDescriptions(m.Closure.CompiledTask.Template.Interface.Inputs.Variables) - } - if m.Closure.CompiledTask.Template.Interface.Outputs != nil { - printer.FormatVariableDescriptions(m.Closure.CompiledTask.Template.Interface.Outputs.Variables) + if m.Closure != nil && m.Closure.CompiledTask != nil { + if m.Closure.CompiledTask.Template != nil { + if m.Closure.CompiledTask.Template.Interface != nil { + if m.Closure.CompiledTask.Template.Interface.Inputs != nil { + printer.FormatVariableDescriptions(m.Closure.CompiledTask.Template.Interface.Inputs.Variables) + } + if m.Closure.CompiledTask.Template.Interface.Outputs != nil { + printer.FormatVariableDescriptions(m.Closure.CompiledTask.Template.Interface.Outputs.Variables) + } + } + } } messages = append(messages, m) } diff --git a/flytectl/cmd/get/workflow.go b/flytectl/cmd/get/workflow.go index 704f7a05197..28c43726285 100644 --- a/flytectl/cmd/get/workflow.go +++ b/flytectl/cmd/get/workflow.go @@ -104,11 +104,19 @@ func WorkflowToTableProtoMessages(l []*admin.Workflow) []proto.Message { messages := make([]proto.Message, 0, len(l)) for _, m := range l { m := proto.Clone(m).(*admin.Workflow) - if m.Closure.CompiledWorkflow.Primary.Template.Interface.Inputs != nil { - printer.FormatVariableDescriptions(m.Closure.CompiledWorkflow.Primary.Template.Interface.Inputs.Variables) - } - if m.Closure.CompiledWorkflow.Primary.Template.Interface.Outputs != nil { - printer.FormatVariableDescriptions(m.Closure.CompiledWorkflow.Primary.Template.Interface.Outputs.Variables) + if m.Closure != nil && m.Closure.CompiledWorkflow != nil { + if m.Closure.CompiledWorkflow.Primary != nil { + if m.Closure.CompiledWorkflow.Primary.Template != nil { + if m.Closure.CompiledWorkflow.Primary.Template.Interface != nil { + if m.Closure.CompiledWorkflow.Primary.Template.Interface.Inputs != nil { + printer.FormatVariableDescriptions(m.Closure.CompiledWorkflow.Primary.Template.Interface.Inputs.Variables) + } + if m.Closure.CompiledWorkflow.Primary.Template.Interface.Outputs != nil { + printer.FormatVariableDescriptions(m.Closure.CompiledWorkflow.Primary.Template.Interface.Outputs.Variables) + } + } + } + } } messages = append(messages, m) }