OSDN Git Service

Fix Issue 1311.
authorJustin Shapcott <support@mobidevelop.com>
Tue, 12 Mar 2013 13:31:35 +0000 (06:31 -0700)
committerJustin Shapcott <support@mobidevelop.com>
Tue, 12 Mar 2013 13:35:52 +0000 (06:35 -0700)
GwtPreferences#getString(key) now returns an empty string when a value
does not exist for the key. This is consistent with the other backends.

backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtPreferences.java

index 3f1a8b8..4345b21 100644 (file)
@@ -139,7 +139,8 @@ public class GwtPreferences implements Preferences {
 \r
        @Override\r
        public String getString (String key) {\r
-               return (String)values.get(key);\r
+               String v = (String)values.get(key);\r
+               return v == null ? "" : v;\r
        }\r
 \r
        @Override\r