Changeset 650 in josm


Ignore:
Timestamp:
2008-06-11T07:24:50+02:00 (16 years ago)
Author:
ramack
Message:
  • even though I think this should not yield a problem, it is safer this way (should close #809)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r647 r650  
    302302                        }
    303303                    }
    304                     DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
    305                     info.append(tr("Timespan: ") + df.format(new Date((long)(earliest.time * 1000))) + " - " + df.format(new Date((long)(latest.time * 1000))));
    306                     int diff = (int)(latest.time - earliest.time);
    307                     info.append(" (" + (diff / 3600) + ":" + ((diff % 3600)/60) + ")");
    308                     info.append("<br>");
     304                    if(earliest != null && latest != null){
     305                        DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
     306                        info.append(tr("Timespan: ") + df.format(new Date((long)(earliest.time * 1000))) + " - " + df.format(new Date((long)(latest.time * 1000))));
     307                        int diff = (int)(latest.time - earliest.time);
     308                        info.append(" (" + (diff / 3600) + ":" + ((diff % 3600)/60) + ")");
     309                        info.append("<br>");
     310                    }
    309311                }
    310312                info.append(tr("Length: ") + new DecimalFormat("#0.00").format(data.length() / 1000) + "km");
Note: See TracChangeset for help on using the changeset viewer.