Add SQL rows.Err handling

This commit is contained in:
Marco Realacci 2022-12-06 22:33:10 +01:00
parent d20b0029bb
commit 4fed541bb7
5 changed files with 21 additions and 2 deletions

View file

@ -46,6 +46,10 @@ func (db *appdbimpl) GetUserStream(uid string, start_index int, limit int) (*[]s
}
photos = append(photos, photo)
}
// We check if the iteration ended prematurely
if err = rows.Err(); err != nil {
return nil, err
}
return &photos, nil
}