diff options
Diffstat (limited to 'client-compiler/src/com/vaadin/tools/CvalChecker.java')
-rw-r--r-- | client-compiler/src/com/vaadin/tools/CvalChecker.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/client-compiler/src/com/vaadin/tools/CvalChecker.java b/client-compiler/src/com/vaadin/tools/CvalChecker.java index b3345c7658..645667be94 100644 --- a/client-compiler/src/com/vaadin/tools/CvalChecker.java +++ b/client-compiler/src/com/vaadin/tools/CvalChecker.java @@ -35,16 +35,17 @@ import java.util.prefs.Preferences; import org.apache.commons.io.IOUtils; import elemental.json.JsonException; +import elemental.json.JsonNull; import elemental.json.JsonObject; import elemental.json.impl.JsonUtil; /** * This class is able to validate the vaadin CVAL license. - * + * * It reads the developer license file and asks the server to validate the * licenseKey. If the license is invalid it throws an exception with the * information about the problem and the server response. - * + * * @since 7.3 */ public final class CvalChecker { @@ -80,6 +81,10 @@ public final class CvalChecker { private static <T> T get(JsonObject o, String k, Class<T> clz) { Object ret = null; try { + if (o == null || o.get(k) == null + || o.get(k) instanceof JsonNull) { + return null; + } if (clz == String.class) { ret = o.getString(k); } else if (clz == JsonObject.class) { @@ -299,7 +304,7 @@ public final class CvalChecker { /** * Given a product name returns the name of the file with the license key. - * + * * Traditionally we have delivered license keys with a name like * 'vaadin.touchkit.developer.license' but our database product name is * 'vaadin-touchkit' so we have to replace '-' by '.' to maintain @@ -340,7 +345,7 @@ public final class CvalChecker { /** * Validate whether there is a valid license key for a product. - * + * * @param productName * for example vaadin-touchkit * @param productVersion |