From 985fcdc48e3babfb15c41fe1c977807bfa451d99 Mon Sep 17 00:00:00 2001 From: Jindrich Makovicka Date: Sun, 5 Jun 2011 18:30:06 +0200 Subject: [PATCH] fix NullPointerException at startup without the tiles directory --- DataExtractionOSM/src/net/osmand/swing/MapPanel.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DataExtractionOSM/src/net/osmand/swing/MapPanel.java b/DataExtractionOSM/src/net/osmand/swing/MapPanel.java index 071710be91..19a8f80db6 100644 --- a/DataExtractionOSM/src/net/osmand/swing/MapPanel.java +++ b/DataExtractionOSM/src/net/osmand/swing/MapPanel.java @@ -69,6 +69,9 @@ public class MapPanel extends JPanel implements IMapDownloaderCallback { for(TileSourceTemplate t : list){ map.put(t.getName(), t); } + if (!dir.isDirectory()) { + return map; + } for(File f : dir.listFiles()){ if(f.isDirectory()){ if(map.containsKey(f.getName())){