[database] fix error when current session's user does not exists in db anymore