Changeset 10032 in josm


Ignore:
Timestamp:
2016-03-23T21:36:16+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #12651 - do not create Notes layer when no notes were downloaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java

    r8908 r10032  
    106106        protected void finish() {
    107107            rememberDownloadedData(new NoteData(notesData));
    108             if (isCanceled() || isFailed()) {
    109                 return;
    110             }
    111 
    112             if (notesData == null) {
     108            if (isCanceled() || isFailed() || notesData == null || notesData.isEmpty()) {
    113109                return;
    114110            }
     
    121117                noteLayers = Main.map.mapView.getLayersOfType(NoteLayer.class);
    122118            }
    123             NoteLayer layer;
    124119            if (noteLayers != null && !noteLayers.isEmpty()) {
    125                 layer = noteLayers.get(0);
    126                 layer.getNoteData().addNotes(notesData);
     120                noteLayers.get(0).getNoteData().addNotes(notesData);
    127121            } else {
    128                 layer = new NoteLayer(notesData, tr("Notes"));
    129                 Main.main.addLayer(layer);
     122                Main.main.addLayer(new NoteLayer(notesData, tr("Notes")));
    130123            }
    131124        }
Note: See TracChangeset for help on using the changeset viewer.