Make image path optional

This commit is contained in:
Andrea Maria Piana 2023-03-20 17:38:56 +00:00
parent ba2aa3f83e
commit 6775e79920
3 changed files with 10 additions and 13 deletions

View File

@ -1 +1 @@
0.138.8
0.138.9

View File

@ -795,14 +795,16 @@ func (b *GethStatusBackend) CreateAccountAndLogin(request *requests.CreateAccoun
return err
}
iis, err := images.GenerateIdentityImages(request.ImagePath, 0, 0, 1000, 1000)
if err != nil {
return err
}
if request.ImagePath != "" {
iis, err := images.GenerateIdentityImages(request.ImagePath, 0, 0, 1000, 1000)
if err != nil {
return err
}
err = b.multiaccountsDB.StoreIdentityImages(info.KeyUID, iis, false)
if err != nil {
return err
err = b.multiaccountsDB.StoreIdentityImages(info.KeyUID, iis, false)
if err != nil {
return err
}
}
return nil

View File

@ -6,7 +6,6 @@ import (
var ErrCreateAccountInvalidDisplayName = errors.New("create-account: invalid display name")
var ErrCreateAccountInvalidPassword = errors.New("create-account: invalid password")
var ErrCreateAccountInvalidImagePath = errors.New("create-account: invalid image path")
var ErrCreateAccountInvalidColor = errors.New("create-account: invalid color")
var ErrCreateAccountInvalidRootKeystoreDir = errors.New("create-account: invalid root keystore directory")
var ErrCreateAccountInvalidBackupDisabledDataDir = errors.New("create-account: invalid backup disabled data directory")
@ -42,10 +41,6 @@ func (c *CreateAccount) Validate() error {
return ErrCreateAccountInvalidPassword
}
if len(c.ImagePath) == 0 {
return ErrCreateAccountInvalidImagePath
}
if len(c.Color) == 0 {
return ErrCreateAccountInvalidColor
}