Update OsmAnd-java/src/net/osmand/util/Algorithms.java

Fix npe