1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-28 22:39:11 +02:00

getSelectorFromElement return null on bad selectors (#27912)

This commit is contained in:
Johann-S
2018-12-23 13:30:35 +01:00
committed by XhmikosR
parent 7d5cb2df3a
commit 3bd9fb3649
3 changed files with 32 additions and 32 deletions

View File

@@ -82,7 +82,11 @@ const Util = {
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''
}
return selector && document.querySelector(selector) ? selector : null
try {
return document.querySelector(selector) ? selector : null
} catch (err) {
return null
}
},
getTransitionDurationFromElement(element) {