Skip to content

Commit ff3bf31

Browse files
authored
Merge pull request #3129 from kikora/codex/undersk-feilmeldinger-i-graftegner
Guard graftegner color picker usage
2 parents af3d7b6 + 3b64632 commit ff3bf31

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

graftegner.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4220,8 +4220,13 @@ function updateCurveColorsFromTheme() {
42204220
if (picker) {
42214221
const hiddenInput = picker.querySelector('input[data-color]');
42224222
if (hiddenInput && appliedColor) {
4223-
hiddenInput.value = normalizeFunctionColorChoice(appliedColor) || appliedColor;
4224-
updateFunctionColorPicker(picker, hiddenInput, appliedColor, getFunctionColorOptions());
4223+
const normalizedColor = typeof normalizeFunctionColorChoice === 'function'
4224+
? normalizeFunctionColorChoice(appliedColor)
4225+
: null;
4226+
hiddenInput.value = normalizedColor || appliedColor;
4227+
if (typeof updateFunctionColorPicker === 'function' && typeof getFunctionColorOptions === 'function') {
4228+
updateFunctionColorPicker(picker, hiddenInput, appliedColor, getFunctionColorOptions());
4229+
}
42254230
}
42264231
}
42274232
}

0 commit comments

Comments
 (0)