Unsafe call of “bread” variable
-
Hello!
In
assets/js/main.js
you call “bread” variable several times. What if the script, which defines this variable, failed to load or was blocked by browser?You not only lose the bread finance functionality, but also it may break the whole JavaScript on the page. I offer to check the type of “bread” variable before using it.
For example, change
if (!bread.apiKey) bread.setAPIKey(breadController.local.bread_api_key);
to
if (typeof(bread) !== 'undefined') { if (!bread.apiKey) bread.setAPIKey(breadController.local.bread_api_key); }
- The topic ‘Unsafe call of “bread” variable’ is closed to new replies.