Skip to content
Snippets Groups Projects

fix segfault in GetKey when there is nill err object

Closed Damyan Mitev requested to merge 13-fix-no-such-key-segfault into master
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -121,8 +121,8 @@ func (s *KeyStorageServerImpl) GetKey(ctx context.Context, in *api.GetKeyRequest
log.Println("No such key " + in.Uuid)
getKeyResponse.Key = nil
getKeyResponse.StatusList = utils.AddStatus(getKeyResponse.StatusList,
"500", api.StatusType_ERROR, err.Error())
return getKeyResponse, err
"500", api.StatusType_ERROR, "No such key " + in.Uuid)
return getKeyResponse, errors.New("No such key " + in.Uuid)
}
getKeyResponse.Key = key
Loading