diff --git a/flytepropeller/pkg/controller/nodes/task/handler.go b/flytepropeller/pkg/controller/nodes/task/handler.go index 4e7e752f62..1b3c507f64 100644 --- a/flytepropeller/pkg/controller/nodes/task/handler.go +++ b/flytepropeller/pkg/controller/nodes/task/handler.go @@ -92,20 +92,24 @@ func (p *pluginRequestedTransition) AddDeckURI(tCtx *taskExecutionContext) { } func (p *pluginRequestedTransition) RemoveDeckURIIfDeckNotExists(ctx context.Context, tCtx *taskExecutionContext) error { + // If there's no output info, nothing to do. + if p.execInfo.OutputInfo == nil { + return nil + } + reader := tCtx.ow.GetReader() if reader == nil { + p.execInfo.OutputInfo.DeckURI = nil return nil } exists, err := reader.DeckExists(ctx) if err != nil { - if p.execInfo.OutputInfo != nil { - p.execInfo.OutputInfo.DeckURI = nil - } + p.execInfo.OutputInfo.DeckURI = nil return regErrors.Wrapf(err, "failed to check existence of deck file") } - if !exists && p.execInfo.OutputInfo != nil { + if !exists { p.execInfo.OutputInfo.DeckURI = nil }