Skip to content

Commit a884a0f

Browse files
revit13Copilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Revital Sur <eres@il.ibm.com>
1 parent ae70cbb commit a884a0f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

pkg/coordinator/steps/render.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,15 @@ func (s *RenderStep) executeGenerate(ctx context.Context, reqCtx *pipeline.Reque
148148
}
149149
reqCtx.TokenIDs = tokenIDs
150150

151-
features, _ := reqCtx.Body["features"].(map[string]any)
152-
entries, err := extractMultimodalEntries(features)
151+
rawFeatures := reqCtx.Body["features"]
152+
var features map[string]any
153+
if rawFeatures != nil {
154+
var ok bool
155+
features, ok = rawFeatures.(map[string]any)
156+
if !ok {
157+
return fmt.Errorf("render: features must be an object, got %T: %w", rawFeatures, pipeline.ErrBadRequest)
158+
}
159+
}
153160
if err != nil {
154161
return fmt.Errorf("render: %w", err)
155162
}

0 commit comments

Comments
 (0)