Changeset 32718 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-07-26T17:19:55+02:00 (8 years ago)
Author:
simon04
Message:

JOSM/wikipedia: avoid queries w/ 0 items

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java

    r32704 r32718  
    196196                    .flatMap(chunk -> getWikidataForArticles(wikipediaLang, chunk).entrySet().stream())
    197197                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
     198        } else if (articles.isEmpty()) {
     199            return Collections.emptyMap();
    198200        }
    199201        try {
     
    256258                    .flatMap(chunk -> getLabelForWikidata(chunk, locale, preferredLanguage).stream())
    257259                    .collect(Collectors.toList());
     260        } else if (entries.isEmpty()) {
     261            return Collections.emptyList();
    258262        }
    259263        try {
Note: See TracChangeset for help on using the changeset viewer.