diff --git a/service/src/main/java/lcsb/mapviewer/services/impl/UserService.java b/service/src/main/java/lcsb/mapviewer/services/impl/UserService.java
index 05f81f61ff774aa08c52175066139d60857eda24..15e752a460c776dedfb1db301500c70e9e53a94c 100644
--- a/service/src/main/java/lcsb/mapviewer/services/impl/UserService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/impl/UserService.java
@@ -104,7 +104,7 @@ public class UserService implements IUserService {
 	@Override
 	public AuthenticationToken login(String login, String password) {
 		User user = userDao.getUserByLoginAndPassword(login, password);
-		if (login.equals(Configuration.ANONYMOUS_LOGIN)) {
+		if (Configuration.ANONYMOUS_LOGIN.equals(login)) {
 			user = getUserByLogin(Configuration.ANONYMOUS_LOGIN);
 		}
 		if (user != null) {