Merge pull request #9303 from osmandapp/quick_fix

Quick fix
This commit is contained in:
Denis Kolomiets 2020-06-23 21:26:29 +03:00 committed by GitHub
commit d39770bc5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,9 +87,8 @@ public class OsmMapUtils {
} }
public static LatLon getComplexPolyCenter(Collection<Node> outer, List<List<Node>> inner) { public static LatLon getComplexPolyCenter(Collection<Node> outer, List<List<Node>> inner) {
if (outer.size() <= 5 && inner == null) { if (!Algorithms.isEmpty(outer) && outer.size() <= 5 && inner == null) {
List<Node> sub = new ArrayList<>(outer); List<Node> sub = new ArrayList<>(outer);
return getWeightCenterForNodes(sub.subList(0, sub.size()-1)); return getWeightCenterForNodes(sub.subList(0, sub.size()-1));
} }