diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java index 27ed3a22e..9b824a81c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/fetching/RemoteFetcher.java @@ -297,7 +297,11 @@ public class RemoteFetcher { } } } else { - mapToMap(id, (Map)obj, item, i == 1); + if (obj instanceof Map) { + mapToMap(id, (Map) 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 source, Map 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); } } }