From 772df1dd46d856e0f49ce11d3f0bb7d0bd665033 Mon Sep 17 00:00:00 2001 From: cepprice Date: Wed, 10 Mar 2021 23:11:08 +0500 Subject: [PATCH] Fix NPE --- OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java b/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java index 737e302e6a..be59b4bf6f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java @@ -1049,7 +1049,7 @@ public class Algorithms { } public static String gradientPaletteToString(int[] colors) { - int[] src = colors.length == 3 ? colors : RouteColorize.colors; + int[] src = (colors != null && colors.length == 3) ? colors : RouteColorize.colors; return Algorithms.colorToString(src[0]) + " " + Algorithms.colorToString(src[1]) + " " + Algorithms.colorToString(src[2]);