From 90752574628606b924b2035776933461a40a1e11 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 17 Aug 2016 00:58:44 +0200 Subject: [PATCH] Fix crash with empty points --- OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java index 646c921c22..2130232d43 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java @@ -328,6 +328,10 @@ public class GpxImportHelper { } private void importFavourites(final GPXUtilities.GPXFile gpxFile, final String fileName, final boolean save) { + if(gpxFile.points == null || gpxFile.points.size() == 0) { + handleResult(gpxFile, fileName, save); + return; + } final DialogInterface.OnClickListener importFavouritesListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) {