Skip uploading nil update

This commit is contained in:
Andy Wang 2020-04-12 01:56:33 +01:00
parent 783d016a29
commit f90a008271
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ func (manager *localManager) AuthoriseNewSession(UID []byte, ainfo Authorisation
// If no action is needed, there won't be a StatusResponse entry for that user
func (manager *localManager) UploadStatus(uploads []StatusUpdate) ([]StatusResponse, error) {
var responses []StatusResponse
if len(uploads) == 0 {
return responses, nil
}
err := manager.db.Update(func(tx *bolt.Tx) error {
for _, status := range uploads {
var resp StatusResponse