Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for npe

Michael Peter Christenef8cd8059381
diff --git a/source/net/yacy/search/index/Segment.java b/source/net/yacy/search/index/Segment.java
index d8683e356..2e68a7956 100644
--- a/source/net/yacy/search/index/Segment.java
+++ b/source/net/yacy/search/index/Segment.java
@@ -506,11 +506,13 @@ public class Segment {
if (!language.equals(url.language())) {
// see if we have a hint in the url that the statistic was right
final String u = urlNormalform.toLowerCase();
- if (!u.contains("/" + language + "/") && !u.contains("/" + ISO639.country(language).toLowerCase() + "/")) {
+ String ISO639_country = ISO639.country(language);
+ if (u.contains("/" + language + "/") ||
+ (ISO639_country != null && u.contains("/" + ISO639.country(language).toLowerCase() + "/"))) {
+ // this is a strong hint that the statistics was in fact correct
+ } else {
// no confirmation using the url, use the TLD
language = url.language();
- } else {
- // this is a strong hint that the statistics was in fact correct
}
}
} else {