KEYCLOAK-1854

NPE in SystemInfoRepresentation if user.country or user.language not set
This commit is contained in:
Stian Thorgersen 2015-09-17 07:38:14 +02:00
parent ca05455aa0
commit 2eaa03539c

View file

@ -46,7 +46,9 @@ public class SystemInfoRepresentation {
rep.userName = System.getProperty("user.name");
rep.userDir = System.getProperty("user.dir");
rep.userTimezone = System.getProperty("user.timezone");
rep.userLocale = (new Locale(System.getProperty("user.country"), System.getProperty("user.language")).toString());
if (System.getProperty("user.country") != null && System.getProperty("user.language") != null) {
rep.userLocale = (new Locale(System.getProperty("user.country"), System.getProperty("user.language")).toString());
}
return rep;
}