File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1069,25 +1069,34 @@ func actionModelToClusterEvents(action *models.Action) []*workflow.ClusterEvent
10691069
10701070// runModelToDetails converts a DB Run model to a RunDetails proto.
10711071func (s * RunService ) runModelToDetails (run * models.Run , runID * common.RunIdentifier ) * workflow.RunDetails {
1072+ if run == nil && runID == nil {
1073+ return nil
1074+ }
10721075 var runSpec * task.RunSpec
1073- if len (run .ActionSpec ) > 0 {
1076+ if run != nil && len (run .ActionSpec ) > 0 {
10741077 var actionSpec workflow.ActionSpec
10751078 if err := json .Unmarshal (run .ActionSpec , & actionSpec ); err == nil {
10761079 runSpec = actionSpec .RunSpec
10771080 }
10781081 }
10791082
1083+ id := & common.ActionIdentifier {
1084+ Run : runID ,
1085+ }
1086+ if run != nil {
1087+ id .Name = run .Name
1088+ }
10801089 return & workflow.RunDetails {
10811090 RunSpec : runSpec ,
1082- Action : s .actionModelToDetails (run , & common.ActionIdentifier {
1083- Run : runID ,
1084- Name : run .Name ,
1085- }),
1091+ Action : s .actionModelToDetails (run , id ),
10861092 }
10871093}
10881094
10891095// actionModelToDetails converts a DB Action model to an ActionDetails proto.
10901096func (s * RunService ) actionModelToDetails (action * models.Action , actionID * common.ActionIdentifier ) * workflow.ActionDetails {
1097+ if action == nil && actionID == nil {
1098+ return nil
1099+ }
10911100 details := & workflow.ActionDetails {
10921101 Id : actionID ,
10931102 }
You can’t perform that action at this time.
0 commit comments