aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2020-03-20 22:33:23 +0100
committerXhmikosR <[email protected]>2020-03-31 21:11:29 +0300
commitdabd458b4b817136e2a34c97d40e8854c344bf69 (patch)
tree675d460ce2690f127325d21905bbe749d82e62f2 /js/src
parent0c8d8a48e143206452a3cb3ee2d8cf1e49488dbb (diff)
downloadbootstrap-dabd458b4b817136e2a34c97d40e8854c344bf69.tar.xz
bootstrap-dabd458b4b817136e2a34c97d40e8854c344bf69.zip
Backport (#30383)
fix: ensure totype always return stringified null when null passed
Diffstat (limited to 'js/src')
-rw-r--r--js/src/util.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/src/util.js b/js/src/util.js
index d130682e3..95186bb66 100644
--- a/js/src/util.js
+++ b/js/src/util.js
@@ -19,6 +19,10 @@ const MILLISECONDS_MULTIPLIER = 1000
// Shoutout AngusCroll (https://goo.gl/pxwQGp)
function toType(obj) {
+ if (obj === null || typeof obj === 'undefined') {
+ return `${obj}`
+ }
+
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()
}