Ticket #17191: infoactions.patch

File infoactions.patch, 1.2 KB (added by taylor.smock, 3 months ago)

Possible defensive implementation

  • src/org/openstreetmap/josm/plugins/osmobjinfo/OSMObjInfoActions.java

     
    102102    }
    103103
    104104    public static void openinBrowserMapillary(String coords) {
     105        if (coords == null || coords.equals("")) return;
    105106        String[] arrCoords = coords.split(",");
    106107        String url = "https://www.mapillary.com/app/?lat=" + arrCoords[0] + "&lng=" + arrCoords[1] + "&z=20&focus=map&dateFrom=2017-01-01";
    107108        new Notification(tr("Open in browser " + url)).setIcon(JOptionPane.INFORMATION_MESSAGE).setDuration(Notification.TIME_SHORT).show();
     
    110111    }
    111112
    112113    public static void openinBrowserOpenstreetcam(String coords) {
     114        if (coords == null || coords.equals("")) return;
    113115        String[] arrCoords = coords.split(",");
    114116        String url = "http://openstreetcam.org/map/@" + arrCoords[0] + "," + arrCoords[1] + ",18z";
    115117        new Notification(tr("Open in browser " + url)).setIcon(JOptionPane.INFORMATION_MESSAGE).setDuration(Notification.TIME_SHORT).show();