]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/gui/WaypointListModel.java
Version 13, August 2011
[GpsPrune.git] / tim / prune / gui / WaypointListModel.java
index e5b41865e739a0cb08dc95382fc82eb692472ffd..350869713c0a2851ad5b47a17502b2422f303d11 100644 (file)
@@ -38,8 +38,11 @@ public class WaypointListModel extends AbstractListModel
         */
        public Object getElementAt(int inIndex)
        {
-               if (inIndex < 0 || inIndex >= getSize()) return "";
-               return _waypoints.get(inIndex).getWaypointName();
+               DataPoint p = null;
+               if (inIndex < 0 || inIndex >= getSize()
+                       || _waypoints == null || (p = _waypoints.get(inIndex)) == null)
+                       return "";
+               return p.getWaypointName();
        }
 
        /**