Added check to null pointer

This commit is contained in:
Ivan Dolgov 2018-03-30 23:34:11 +07:00
parent f4bffad07a
commit ed1f7bfc1a

View file

@ -157,14 +157,15 @@ public class BinaryMapDataObject {
public int getSimpleLayer(){
if(mapIndex != null) {
for (int i = 0; i < additionalTypes.length; i++) {
if (mapIndex.positiveLayers.contains(additionalTypes[i])) {
return 1;
} else if (mapIndex.negativeLayers.contains(additionalTypes[i])) {
return -1;
if (additionalTypes != null) {
for (int i = 0; i < additionalTypes.length; i++) {
if (mapIndex.positiveLayers.contains(additionalTypes[i])) {
return 1;
} else if (mapIndex.negativeLayers.contains(additionalTypes[i])) {
return -1;
}
}
}
}
return 0;
}