From f90a008271120560f238e6ec2404c0c95f15bfdd Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Sun, 12 Apr 2020 01:56:33 +0100 Subject: [PATCH] Skip uploading nil update --- internal/server/usermanager/localmanager.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/server/usermanager/localmanager.go b/internal/server/usermanager/localmanager.go index 53e402e..7a8bdb8 100644 --- a/internal/server/usermanager/localmanager.go +++ b/internal/server/usermanager/localmanager.go @@ -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