summaryrefslogtreecommitdiffstats
path: root/client-compiler/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-12-18 18:30:09 +0200
committerLeif Åstrand <leif@vaadin.com>2014-12-18 18:30:09 +0200
commite3d0fbbab68f9ef8642a975741d9f576993b1f38 (patch)
tree5711a31c5af1d3773a86b4d25c9f8064aa435ecc /client-compiler/src
parent434fb5bf5cf62490686367e9193b7898077bbd44 (diff)
parent68eec666b55c42b4a55235c00bc78f6212eb2062 (diff)
downloadvaadin-framework-e3d0fbbab68f9ef8642a975741d9f576993b1f38.tar.gz
vaadin-framework-e3d0fbbab68f9ef8642a975741d9f576993b1f38.zip
Merge remote-tracking branch 'origin/master' into grid
Change-Id: Ic7629f9cedb3c948edf4f63c678ca499e3d52805
Diffstat (limited to 'client-compiler/src')
-rw-r--r--client-compiler/src/com/vaadin/tools/CvalChecker.java13
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