fix NullPointerException at startup without the tiles directory

This commit is contained in:
Jindrich Makovicka 2011-06-05 18:30:06 +02:00
parent 49ed089370
commit 985fcdc48e

View file

@ -69,6 +69,9 @@ public class MapPanel extends JPanel implements IMapDownloaderCallback {
for(TileSourceTemplate t : list){ for(TileSourceTemplate t : list){
map.put(t.getName(), t); map.put(t.getName(), t);
} }
if (!dir.isDirectory()) {
return map;
}
for(File f : dir.listFiles()){ for(File f : dir.listFiles()){
if(f.isDirectory()){ if(f.isDirectory()){
if(map.containsKey(f.getName())){ if(map.containsKey(f.getName())){