prevent NPE during initialization of very large vocabularies

pull/1/head
Michael Peter Christen 10 years ago
parent aaf7d4775a
commit 9e588944fa

@ -127,7 +127,7 @@ public class yacysearch {
prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
// produce vocabulary navigation sidebars
Collection<Tagging> vocabularies = LibraryProvider.autotagging == null ? new ArrayList<Tagging>(0) : LibraryProvider.autotagging.getVocabularies();
Collection<Tagging> vocabularies = LibraryProvider.autotagging.getVocabularies();
int j = 0;
for (Tagging v: vocabularies) {
prop.put("sidebarVocabulary_" + j + "_vocabulary", v.getName());

@ -61,7 +61,7 @@ public class LibraryProvider {
public static final String disabledExtension = ".disabled";
public static WordCache dymLib = new WordCache(null);
public static AutotaggingLibrary autotagging = null;
public static AutotaggingLibrary autotagging = new AutotaggingLibrary(null); // initialize empty to prevent NPE during initialization
public static URLRewriterLibrary urlRewriter = null;
public static OverarchingLocation geoLoc = new OverarchingLocation();
private static File dictSource = null;

Loading…
Cancel
Save