From 753c827e1c6ed019b6dada3efe4589494cd8aa5e Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 13 Nov 2009 09:18:49 +0000 Subject: [PATCH] Added null check as all jars do not include a manifest svn changeset:9779/svn branch:6.2 --- .../gwt/widgetsetutils/ClassPathExplorer.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java index 269d911ad1..cdc569cb66 100644 --- a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java +++ b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java @@ -41,7 +41,7 @@ import com.vaadin.ui.ClientWidget; * appropriate monkey code for gwt directly in annotation processor and get rid * of {@link WidgetMapGenerator}. Using annotation processor might be a good * idea when dropping Java 1.5 support (integrated to javac in 6). - * + * */ public class ClassPathExplorer { private final static FileFilter DIRECTORIES_ONLY = new FileFilter() { @@ -75,7 +75,7 @@ public class ClassPathExplorer { /** * Finds available widgetset names. - * + * * @return */ public static Map getAvailableWidgetSets() { @@ -133,6 +133,10 @@ public class ClassPathExplorer { JarFile jarFile = conn.getJarFile(); Manifest manifest = jarFile.getManifest(); + if (manifest == null) { + // No manifest so this is not a Vaadin Add-on + return; + } String value = manifest.getMainAttributes().getValue( "Vaadin-Widgetsets"); if (value != null) { @@ -238,7 +242,7 @@ public class ClassPathExplorer { /** * Recursively add subdirectories and jar files to classpathlocations - * + * * @param name * @param file * @param locations @@ -374,12 +378,12 @@ public class ClassPathExplorer { /** * Find and return the default source directory where to create new * widgetsets. - * + * * Return the first directory (not a JAR file etc.) on the classpath by * default. - * + * * TODO this could be done better... - * + * * @return URL */ public static URL getDefaultSourceDirectory() { -- 2.39.5