Fix an error when user not logged in.

Change-Id: I6c22b8007cf5d9536185dfb5ee0d25e6427386f0