Skip to content

Commit

Permalink
chore: from nil to empty string
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy committed Dec 19, 2023
1 parent 92707c4 commit f2ffbaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/service/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (s *FunctionService) UpdateFunction(a *asset.UpdateFunctionParam, requester
return orcerrors.NewPermissionDenied("requester does not own the function")
}

if function.Image == nil && function.Status == asset.FunctionStatus_FUNCTION_STATUS_READY {
if function.Image.Checksum == "" && function.Status == asset.FunctionStatus_FUNCTION_STATUS_READY {
return orcerrors.FromValidationError(asset.FunctionKind, errors.New("Image should not be null when function status is ready"))
}

Expand Down
2 changes: 1 addition & 1 deletion server/standalone/dbal/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (d *DBAL) AddFunction(function *asset.Function) error {
}

var imageStorageAdress sql.NullString
if function.Image != nil {
if function.Image.Checksum != "" {
err = d.addAddressable(function.Image)
if err != nil {
return err
Expand Down

0 comments on commit f2ffbaa

Please sign in to comment.