Bug fix for nil pointer on image save
This commit is contained in:
parent
d6c3153fe8
commit
8be391fc79
|
@ -87,7 +87,10 @@ func (d *Database) StoreIdentityImages(iis []*IdentityImage) (err error) {
|
|||
defer stmt.Close()
|
||||
|
||||
for _, ii := range iis {
|
||||
_, err = stmt.Exec(&ii.Name, &ii.Payload, &ii.Width, &ii.Height, &ii.FileSize, &ii.ResizeTarget)
|
||||
if ii == nil {
|
||||
continue
|
||||
}
|
||||
_, err = stmt.Exec(ii.Name, ii.Payload, ii.Width, ii.Height, ii.FileSize, ii.ResizeTarget)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ func GenerateIdentityImages(filepath string, aX, aY, bX, bY int) ([]*IdentityIma
|
|||
return nil, err
|
||||
}
|
||||
|
||||
iis := make([]*IdentityImage, len(ResizeDimensions))
|
||||
var iis []*IdentityImage
|
||||
for _, s := range ResizeDimensions {
|
||||
rImg := Resize(s, cImg)
|
||||
|
||||
|
|
Loading…
Reference in New Issue