Avoid JS errors if Sourcebuster library isn't loaded (#46723)
* Don't initialize or handle data if SBJS isn't loaded
This commit is contained in:
parent
afc471d0ed
commit
2d71790b72
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Add a bailout to prevent JavaScript errors if Sourcebuster isn't loaded
|
|
@ -65,6 +65,8 @@
|
|||
if ( ! allow ) {
|
||||
// Reset cookies, and clear form data.
|
||||
removeTrackingCookies();
|
||||
} else if ( typeof sbjs === 'undefined' ) {
|
||||
return; // Do nothing, as sourcebuster.js is not loaded.
|
||||
} else {
|
||||
// If not done yet, initialize sourcebuster.js which populates `sbjs.get` object.
|
||||
sbjs.init( {
|
||||
|
|
Loading…
Reference in New Issue