From 51b594c4171af0d725d0c455895d5845af737644 Mon Sep 17 00:00:00 2001 From: Akash Yadav Date: Fri, 10 Nov 2023 00:44:17 +0530 Subject: [PATCH] fix(editor): NoSuchElementException when parsing color value from color scheme --- .../itsaky/androidide/editor/schemes/internal/parser/common.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/common.kt b/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/common.kt index 204cadd10..8c5f03393 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/common.kt +++ b/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/common.kt @@ -47,7 +47,7 @@ fun IDEColorScheme.parseColorValue(value: String?, colorId: Boolean = true): Int val refName = value.substring(1) val refValue = definitions[refName] ?: throw ParseException("Referenced color '$value' not found") - return if (colorId) refValue else colorIds.get(refValue) + return if (colorId) refValue else colorIds.getOrDefault(refValue, 0) } if (value[0] == '#') {