Fix issue 331 and issue 306
This commit is contained in:
parent
4c6fb0bf77
commit
5fbe56c00f
1 changed files with 2 additions and 2 deletions
|
@ -329,7 +329,7 @@ public class BinaryMapIndexWriter {
|
|||
}
|
||||
|
||||
int restrictionsSize = 0;
|
||||
if(restrictions.length > 0){
|
||||
if(restrictions != null && restrictions.length > 0){
|
||||
allSize += CodedOutputStream.computeTagSize(OsmandOdb.MapData.RESTRICTIONS_FIELD_NUMBER);
|
||||
for (int i = 0; i < restrictions.length / 8; i++) {
|
||||
long l = Algoritms.parseLongFromBytes(restrictions, i * 8) - stackBaseIds.peek();
|
||||
|
@ -376,7 +376,7 @@ public class BinaryMapIndexWriter {
|
|||
codedOutStream.writeUInt32(OsmandOdb.MapData.STRINGID_FIELD_NUMBER, nameId);
|
||||
}
|
||||
|
||||
if(restrictions.length > 0){
|
||||
if(restrictions != null && restrictions.length > 0){
|
||||
codedOutStream.writeTag(OsmandOdb.MapData.RESTRICTIONS_FIELD_NUMBER, WireFormat.FieldType.BYTES.getWireType());
|
||||
codedOutStream.writeRawVarint32(restrictionsSize);
|
||||
for (int i = 0; i < restrictions.length / 8; i++) {
|
||||
|
|
Loading…
Reference in a new issue