Skip to content

Beautiful Open-Source Form Builder

Fix button issue

Julien Nahumd71bdf533e1c
diff --git a/client/components/open/forms/OpenFormButton.vue b/client/components/open/forms/OpenFormButton.vue
index 56a3d9a70..76f3802ba 100644
--- a/client/components/open/forms/OpenFormButton.vue
+++ b/client/components/open/forms/OpenFormButton.vue
@@ -64,6 +64,9 @@ export default {
methods: {
getTextColor (bgColor, lightColor = '#FFFFFF', darkColor = '#000000') {
+ if (!bgColor) {
+ return darkColor
+ }
const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor
const r = parseInt(color.substring(0, 2), 16) // hexToR
const g = parseInt(color.substring(2, 4), 16) // hexToG