diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index dbfd4c1abc..d4cd1174e0 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -594,16 +594,18 @@ public class OsmandSettings { } private TileSourceTemplate checkAmongAvailableTileSources(File dir, List list){ - for (TileSourceTemplate l : list) { - if (dir.getName().equals(l.getName())) { - try { - dir.mkdirs(); - TileSourceManager.createMetaInfoFile(dir, l, true); - } catch (IOException e) { + if (list != null) { + for (TileSourceTemplate l : list) { + if (dir.getName().equals(l.getName())) { + try { + dir.mkdirs(); + TileSourceManager.createMetaInfoFile(dir, l, true); + } catch (IOException e) { + } + return l; } - return l; + } - } return null; }