]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - src/tim/prune/gui/profile/ProfileChart.java
Version 20.2, January 2021
[GpsPrune.git] / src / tim / prune / gui / profile / ProfileChart.java
index 5d18e1e9892b5c40f0fffca9338f8ecc4aca6f0d..95d800420f9d89231e15c2045a7411eb8acbe859 100644 (file)
@@ -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());