From 47f9251c876d9ee432618421a55b5915aca37456 Mon Sep 17 00:00:00 2001 From: Emux Date: Wed, 12 Sep 2018 20:53:29 +0300 Subject: [PATCH] MapTile.unlock improvements #539 --- vtm/src/org/oscim/layers/tile/MapTile.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vtm/src/org/oscim/layers/tile/MapTile.java b/vtm/src/org/oscim/layers/tile/MapTile.java index 12de85c3..d6b386c0 100644 --- a/vtm/src/org/oscim/layers/tile/MapTile.java +++ b/vtm/src/org/oscim/layers/tile/MapTile.java @@ -253,8 +253,11 @@ public class MapTile extends Tile { } for (int i = 0; i < 4; i++) { - if ((proxy & (1 << i)) != 0) - node.child(i).refs--; + if ((proxy & (1 << i)) != 0) { + MapTile c = node.child(i); + if (c != null) + c.refs--; + } } /* removed all proxy references for this tile */