Small fix

This commit is contained in:
Vitaliy 2021-03-02 00:13:49 +02:00
parent 8d1ce38f4f
commit c092551bda

View file

@ -1,5 +1,9 @@
package net.osmand.plus.settings.backend;
import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.core.content.ContextCompat;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
@ -26,10 +30,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.core.content.ContextCompat;
import static net.osmand.plus.views.mapwidgets.MapWidgetRegistry.WIDGET_ALTITUDE;
import static net.osmand.plus.views.mapwidgets.MapWidgetRegistry.WIDGET_BATTERY;
import static net.osmand.plus.views.mapwidgets.MapWidgetRegistry.WIDGET_BEARING;
@ -505,8 +505,12 @@ public class ApplicationMode {
}
public Integer getCustomIconColor() {
String customColor = app.getSettings().CUSTOM_ICON_COLOR.getModeValue(this);
return customColor == null ? null : Algorithms.parseColor(customColor);
try {
String customColor = app.getSettings().CUSTOM_ICON_COLOR.getModeValue(this);
return Algorithms.isEmpty(customColor) ? null : Algorithms.parseColor(customColor);
} catch (IllegalArgumentException e) {
return null;
}
}
public void setCustomIconColor(Integer customIconColor) {