diff --git a/src/components/utils/DomHandler.js b/src/components/utils/DomHandler.js index e7eeaebe8..5cab381f8 100755 --- a/src/components/utils/DomHandler.js +++ b/src/components/utils/DomHandler.js @@ -143,10 +143,14 @@ export default class DomHandler { } static hasClass(element, className) { - if (element.classList) - return element.classList.contains(className); - else - return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className); + if (element) { + if (element.classList) + return element.classList.contains(className); + else + return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className); + } + + return false; } static find(element, selector) {