diff --git a/notifications/notifications.go b/notifications/notifications.go index ba3132979866590a8786cd341508ea869c6d4236..802d79a288498bbe2182d0aaaca42bb3810ae42f 100644 --- a/notifications/notifications.go +++ b/notifications/notifications.go @@ -209,6 +209,9 @@ func (nb *Impl) RegisterForNotifications(clientToken []byte, auth *connect.Auth) if !auth.IsAuthenticated { return errors.New("Cannot register for notifications: client is not authenticated") } + if string(clientToken) == "" { + return errors.New("Cannot register for notifications with empty client token") + } // Implement this u := &storage.User{ Id: auth.Sender.GetId(),