From d92989cbe75464c60badd4ab40c32efebdadced3 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 9 Jan 2019 12:40:58 +0100 Subject: [PATCH] AbstractHafasClientInterfaceProvider: Derive missing foreground colors in 'icoL'. --- .../schildbach/pte/AbstractHafasClientInterfaceProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java b/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java index ba9b37ed..55eca57b 100644 --- a/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java @@ -907,7 +907,8 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas final JSONObject ico = icoList.getJSONObject(i); if (ico.has("bg")) { final int background = parseIcoColor(ico.getJSONObject("bg")); - final int foreground = parseIcoColor(ico.getJSONObject("fg")); + final JSONObject fg = ico.optJSONObject("fg"); + final int foreground = fg != null ? parseIcoColor(fg) : Style.deriveForegroundColor(background); final String shp = ico.optString("shp", null); if (shp == null) { styles.add(new Style(background, foreground));