diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/ufed/ReportGenerator.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/ufed/ReportGenerator.java index 5391b58d10..a330e187e8 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/ufed/ReportGenerator.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/ufed/ReportGenerator.java @@ -70,18 +70,23 @@ private String formatLocation(Message message) { if ((lat == null || lon == null) && localization != null) { String coord = localization.getLocations(); String[] coordSplit = coord.split(";"); - lat = StringUtils.firstNonBlank(lat, coordSplit[0]); - lon = StringUtils.firstNonBlank(lat, coordSplit[1]); + if (coordSplit.length == 2) { + lat = coordSplit[0]; + lon = coordSplit[1]; + } + } + + lat = StringUtils.replace(lat, ",", "."); + lon = StringUtils.replace(lon, ",", "."); + + DivTag div = div(img(attrs(".location")), b(Messages.getString("UfedChatReport.Location.Title")), br()); + + if (!StringUtils.isAllBlank(lat, lon)) { + div.with(table(attrs(".contact-table"), // + tr(td(Messages.getString("UfedChatReport.Location.Latitude")), td(lat)), // + tr(td(Messages.getString("UfedChatReport.Location.Longitude")), td(lon))), // + br()); } - - lat = StringUtils.defaultString(lat).replace(",", "."); - lon = StringUtils.defaultString(lon).replace(",", "."); - - DivTag div = div(img(attrs(".location")), b(Messages.getString("UfedChatReport.Location.Title")), br(), - table(attrs(".contact-table"), // - tr(td(Messages.getString("UfedChatReport.Location.Latitude")), td(lat)), - tr(td(Messages.getString("UfedChatReport.Location.Longitude")), td(lon))), - br()); if (localization != null) { String name = localization.getName();