X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=src%2Ftim%2Fprune%2Fgui%2Fprofile%2FProfileChart.java;fp=src%2Ftim%2Fprune%2Fgui%2Fprofile%2FProfileChart.java;h=95d800420f9d89231e15c2045a7411eb8acbe859;hp=5d18e1e9892b5c40f0fffca9338f8ecc4aca6f0d;hb=91b72650132900084810e58144e2d7cc91150924;hpb=38a0c12649e9104d0d40ce93a932b9086011f8c8 diff --git a/src/tim/prune/gui/profile/ProfileChart.java b/src/tim/prune/gui/profile/ProfileChart.java index 5d18e1e..95d8004 100644 --- a/src/tim/prune/gui/profile/ProfileChart.java +++ b/src/tim/prune/gui/profile/ProfileChart.java @@ -382,6 +382,11 @@ public class ProfileChart extends GenericDisplay implements MouseListener */ private synchronized void makePopup() { + if (_track.getNumPoints() < 1) + { + _popup = null; + return; + } _popup = new JPopupMenu(); JMenuItem altItem = new JMenuItem(I18nManager.getText("fieldname.altitude")); altItem.addActionListener(new ActionListener() { @@ -527,7 +532,7 @@ public class ProfileChart extends GenericDisplay implements MouseListener } } } - else + else if (_popup != null) { // right clicks _popup.show(this, e.getX(), e.getY());