Skip to content

Commit

Permalink
Avoid undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
gr0 committed Sep 28, 2021
1 parent 639d6a7 commit 11a1d1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/ajax/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export function checkTaint(url: string, taint: string): boolean {
}

export function isUrlIgnored(url: string, ignoreList: string[]): boolean {
if (ignoreList === null || ignoreList === undefined) {
return false;
}
for (let i = 0; i < ignoreList.length; i += 1) {
if (url.toLowerCase().startsWith(ignoreList[i].toLowerCase())) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import MeasureDispatcher from './dispatchers/MeasureDispatcher';

const contextNames = window.STRUM_CONTEXTS || [GLOBAL_KEY];
let ignoreList = window.STRUM_IGNORE_AJAX;
if (ignoreList === null) {
if (ignoreList === null || ignoreList === undefined) {
ignoreList = [];
}

Expand Down

0 comments on commit 11a1d1f

Please sign in to comment.