From 4fc3b20e5d5458943bab5f4124d37f5aade0650b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 28 May 2018 22:12:20 +0200 Subject: [PATCH] Fix crashes --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 4 ++-- OsmAnd/src/net/osmand/plus/GPXUtilities.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 9fb04f29ba..99232cface 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -13,7 +13,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.os.Build; import android.support.v7.app.AlertDialog; - +import android.util.Log; import net.osmand.IProgress; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; @@ -67,7 +67,6 @@ import java.util.Locale; import java.util.Random; import btools.routingapp.BRouterServiceConnection; - import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent; import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck; import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn; @@ -353,6 +352,7 @@ public class AppInitializer implements IProgress { return app.getString(in); } } catch (Exception e) { + LOG.info("No translation: " + keyName); } return null; } diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java index b7a2168538..0edaec5933 100644 --- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java +++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java @@ -1231,7 +1231,9 @@ public class GPXUtilities { public static String writeGpxFile(File fout, GPXFile file, OsmandApplication ctx) { Writer output = null; try { - fout.getParentFile().mkdirs(); + if(fout.getParentFile() != null) { + fout.getParentFile().mkdirs(); + } output = new OutputStreamWriter(new FileOutputStream(fout), "UTF-8"); //$NON-NLS-1$ String msg = writeGpx(output, file, ctx); if(Algorithms.isEmpty(file.path)) {