diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java index d279d72028..82a730ed77 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -694,11 +694,10 @@ public class BinaryMapPoiReaderAdapter { StringBuilder retValue = new StringBuilder(); PoiCategory amenityType = null; LinkedList textTags = null; - boolean isForbidden = false; while (true) { int t = codedIS.readTag(); int tag = WireFormat.getTagFieldNumber(t); - if (amenityType == null && (tag > OsmandOdb.OsmAndPoiBoxDataAtom.CATEGORIES_FIELD_NUMBER || tag == 0) || isForbidden) { + if (amenityType == null && (tag > OsmandOdb.OsmAndPoiBoxDataAtom.CATEGORIES_FIELD_NUMBER || tag == 0)) { codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); return null; } @@ -773,8 +772,8 @@ public class BinaryMapPoiReaderAdapter { } } subtype = poiTypes.replaceDeprecatedSubtype(type, subtype); - isForbidden = poiTypes.isKeyNameForbidden(subtype); - if (req.poiTypeFilter == null || req.poiTypeFilter.accept(type, subtype)) { + boolean isForbidden = poiTypes.isKeyNameForbidden(subtype); + if (!isForbidden && (req.poiTypeFilter == null || req.poiTypeFilter.accept(type, subtype))) { if (amenityType == null) { amenityType = type; am.setSubType(subtype);