From d42dea8907f21a627856ec8ec26d72efc08d775e Mon Sep 17 00:00:00 2001 From: Easton Li Date: Wed, 31 Mar 2021 14:04:50 +0800 Subject: [PATCH] add err handling, avoid panic --- rpc/transform.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpc/transform.go b/rpc/transform.go index 4e028c4b5..9a0827055 100644 --- a/rpc/transform.go +++ b/rpc/transform.go @@ -213,6 +213,9 @@ func toCoreBuildOptions(b *pb.BuildImageOptions) (*types.BuildOptions, error) { func toCoreReplaceOptions(r *pb.ReplaceOptions) (*types.ReplaceOptions, error) { deployOpts, err := toCoreDeployOptions(r.DeployOpt) + if err != nil { + return nil, err + } replaceOpts := &types.ReplaceOptions{ DeployOptions: *deployOpts,