From 559a715236ab5b87d7d6e86eaf690f604e85ac80 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 28 May 2018 22:12:20 +0200 Subject: [PATCH] Fix crashes Conflicts: OsmAnd/src/net/osmand/plus/AppInitializer.java --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 1 + OsmAnd/src/net/osmand/plus/GPXUtilities.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index b19a20700f..6891bcac04 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -352,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)) {