Fixed issues when retrieving data from external sources

This commit is contained in:
George Kalampokis 2020-09-11 14:29:12 +03:00
parent b66fe982f5
commit 88ea24d367
1 changed files with 13 additions and 7 deletions

View File

@ -297,7 +297,11 @@ public class RemoteFetcher {
}
}
} else {
mapToMap(id, (Map<String, String>)obj, item, i == 1);
if (obj instanceof Map) {
mapToMap(id, (Map<String, String>) obj, item, i == 1);
} else if (obj != null){
item.put(id, obj.toString());
}
}
}
}
@ -502,14 +506,16 @@ public class RemoteFetcher {
}
private void mapToMap(String key, Map<String, String> source, Map<String, String> destination, boolean isTitle) {
String content = source.get("content");
if (isTitle) {
String classId = source.get("classid");
if (classId.equals("main title")) {
if (source != null) {
String content = source.get("content");
if (isTitle) {
String classId = source.get("classid");
if (classId.equals("main title")) {
destination.put(key, content);
}
} else {
destination.put(key, content);
}
} else {
destination.put(key, content);
}
}
}