Ignore:
Timestamp:
2017-04-17T19:15:26+02:00 (7 years ago)
Author:
donvip
Message:

fix #josm14400 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java

    r32552 r33263  
    6565                        History h = HistoryDataSet.getInstance().getHistory(id, type);
    6666
     67                        if (h == null) {
     68                            Main.warn("Cannot find history for " + type + " " + id);
     69                            return;
     70                        }
     71
    6772                        HistoryOsmPrimitive hPrimitive1 = h.getLatest();
    6873                        HistoryOsmPrimitive hPrimitive2;
     
    117122
    118123                                Relation rel = new Relation(id, (int) hPrimitive1.getVersion());
    119 
    120124                                HistoryRelation hRel = (HistoryRelation) hPrimitive2;
    121125
     
    142146                                        members.add(new RelationMember(m.getRole(), p));
    143147                                    }
    144 
    145148                                    rel.setMembers(members);
    146149                                }
    147 
    148150                                primitive = rel;
    149151                            }
     
    166168                                  ? tr("Unable to undelete relation {0}. Object has likely been redacted", id)
    167169                                  : null;
    168                                 GuiHelper.runInEDT(new Runnable() {
    169                                     @Override
    170                                     public void run() {
    171                                         new Notification(msg).setIcon(JOptionPane.WARNING_MESSAGE).show();
    172                                     }
    173                                 });
     170                                GuiHelper.runInEDT(() -> new Notification(msg).setIcon(JOptionPane.WARNING_MESSAGE).show());
    174171                                Main.warn(msg);
    175172                            }
     
    187184                Main.map.repaint();
    188185            }
    189             GuiHelper.runInEDT(new Runnable() {
    190                 @Override
    191                 public void run() {
    192                     AutoScaleAction.zoomTo(layer.data.allNonDeletedPrimitives());
    193                 }
    194             });
     186            GuiHelper.runInEDT(() -> AutoScaleAction.zoomTo(layer.data.allNonDeletedPrimitives()));
    195187        }
    196188    }
Note: See TracChangeset for help on using the changeset viewer.