Skip to content

Commit

Permalink
'#1487 Error treatmento to when there is no
Browse files Browse the repository at this point in the history
NominatimTask.NOMINATIM_METADATA metadata in the case.
  • Loading branch information
patrickdalla committed Sep 21, 2023
1 parent 0f1045f commit 700952a
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,18 @@ public boolean hasUnableToGeoCode() {
LeafReader reader = app.getIPEDSource().getLeafReader();

SortedSetDocValues ssdv = reader.getSortedSetDocValues(NominatimTask.NOMINATIM_METADATA);
TermsEnum te = ssdv.termsEnum();
BytesRef br = te.next();
if (br != null) {
if (br.utf8ToString().startsWith(NominatimTask.JSON_ERROR_PREFIX)) {
hasUnableToGeoCode = true;
} else {
hasUnableToGeoCode = false;
if (ssdv != null) {
TermsEnum te = ssdv.termsEnum();
BytesRef br = te.next();
if (br != null) {
if (br.utf8ToString().startsWith(NominatimTask.JSON_ERROR_PREFIX)) {
hasUnableToGeoCode = true;
} else {
hasUnableToGeoCode = false;
}
}

} else {
hasUnableToGeoCode = false;
}
} catch (IOException e) {
// TODO: handle exception
Expand Down

0 comments on commit 700952a

Please sign in to comment.