diff --git a/vtm/src/org/oscim/layers/tile/vector/VectorTileLayer.java b/vtm/src/org/oscim/layers/tile/vector/VectorTileLayer.java index 8835f1d02..80dd7722e 100644 --- a/vtm/src/org/oscim/layers/tile/vector/VectorTileLayer.java +++ b/vtm/src/org/oscim/layers/tile/vector/VectorTileLayer.java @@ -1,5 +1,6 @@ /* * Copyright 2013 Hannes Janetzek + * Copyright 2016 Longri * * This file is part of the OpenScienceMap project (http://www.opensciencemap.org). * @@ -175,7 +176,8 @@ public void addHook(TileLoaderThemeHook h) { @Override public void onDetach() { super.onDetach(); - mTileSource.close(); + if (mTileSource != null) + mTileSource.close(); } public void callThemeHooks(MapTile tile, RenderBuckets layers, MapElement element,