Skip to content

Commit 3640128

Browse files
committed
added nil check
1 parent d8a7dff commit 3640128

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apix/v1alpha2/inferencepool_conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (dst *InferencePool) ConvertFrom(src *v1.InferencePool) error {
8282

8383
func convertStatusToV1(src *InferencePoolStatus) (*v1.InferencePoolStatus, error) {
8484
if src == nil {
85-
return nil, nil
85+
return nil, errors.New("src cannot be nil")
8686
}
8787
u, err := toUnstructured(src)
8888
if err != nil {
@@ -93,7 +93,7 @@ func convertStatusToV1(src *InferencePoolStatus) (*v1.InferencePoolStatus, error
9393

9494
func convertStatusFromV1(src *v1.InferencePoolStatus) (*InferencePoolStatus, error) {
9595
if src == nil {
96-
return nil, nil
96+
return nil, errors.New("src cannot be nil")
9797
}
9898
u, err := toUnstructured(src)
9999
if err != nil {

0 commit comments

Comments
 (0)