keycloak-aplcache

KEYCLOAK-1854 NPE in SystemInfoRepresentation if user.country

9/17/2015 2:38:14 AM

Details

diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java b/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java
index bc0329a..e34edc9 100644
--- a/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java
@@ -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;
     }