Skip to content

Commit 0426e3c

Browse files
authored
Merge pull request containerd#10133 from AkihiroSuda/fix-10062
cri: introspectRuntimeFeatures: fix nil panic
2 parents 01ed3ff + c27bcdc commit 0426e3c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/cri/server/service.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,11 @@ func introspectRuntimeFeatures(ctx context.Context, intro introspection.Service,
409409
if err != nil {
410410
return nil, err
411411
}
412-
rr.Options, err = protobuf.MarshalAnyToProto(options)
413-
if err != nil {
414-
return nil, fmt.Errorf("failed to marshal %T: %w", options, err)
412+
if options != nil {
413+
rr.Options, err = protobuf.MarshalAnyToProto(options)
414+
if err != nil {
415+
return nil, fmt.Errorf("failed to marshal %T: %w", options, err)
416+
}
415417
}
416418

417419
infoResp, err := intro.PluginInfo(ctx, string(plugins.RuntimePluginV2), "task", rr)

0 commit comments

Comments
 (0)