From 41074b0e7e97401f387f70c4df684d49c75792bf Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 21 Oct 2020 13:58:07 +0300 Subject: [PATCH] Fixed #586 - Dropdown inside datable using showClear causing: Cannot read property 'classList' of null --- src/components/utils/DomHandler.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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) {