diff --git a/javascript_implementation/jsColor.js b/javascript_implementation/jsColor.js index 89febb6..0c8b144 100644 --- a/javascript_implementation/jsColor.js +++ b/javascript_implementation/jsColor.js @@ -135,7 +135,7 @@ colorPickerUI = (colorPicker ? colorPicker.nodes.colorPicker : undefined), animationSpeed = colorPicker ? colorPicker.color.options.animationSpeed : 0, isColorPicker = colorPicker && (function(elm) { - while (elm) { + while (elm && elm instanceof HTMLElement) { if ((elm.className || '').indexOf('cp-app') !== -1) return elm; elm = elm.parentNode; } @@ -233,4 +233,4 @@ (options.secure ? '; secure' : ''); } }; -})(this); \ No newline at end of file +})(this);