Skip to content

Commit

Permalink
Add a check to avoid undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauriC committed Dec 9, 2023
1 parent 79f4956 commit 8a1735e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tarteaucitron.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ var tarteaucitron = {
var allowBtnsInSite = document.querySelectorAll(".tarteaucitronAllow:not(#tarteaucitronRoot .tarteaucitronAllow)");
for (i = 0; i < allowBtnsInSite.length; i++) {
tarteaucitron.addClickEventToElement(allowBtnsInSite[i], function () {
if(this.closest('.tac_activate').parentNode !== null) {
if(this.closest('.tac_activate') !== null && this.closest('.tac_activate').parentNode !== null) {
this.closest('.tac_activate').parentNode.setAttribute("tabindex", "-1");
this.closest('.tac_activate').parentNode.focus();
}
Expand Down
2 changes: 1 addition & 1 deletion tarteaucitron.min.js

Large diffs are not rendered by default.

0 comments on commit 8a1735e

Please sign in to comment.