Skip to content

Commit

Permalink
querySelectorAll not finding proper links
Browse files Browse the repository at this point in the history
Error when not being able to load cards via the `a` tag selector. The only `a` tag it finds in the troubleshooting guide. In the case of it not being able to load the resources, the selector returns null. Checking getAttribute on an undefined variable throws an error.

`Your browser was unable to load all of Trello's resources. They may have been blocked by your firewall, proxy or browser configuration.`
  • Loading branch information
hemstreet authored Oct 24, 2017
1 parent 2a102c9 commit 1e6bf89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trello-card-numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ window.addEventListener('load', function() {
showCardIds();
var card = node.querySelectorAll(CARD_LINK_QUERY_SELECTOR)[0];
var duplicateCheck = node.querySelectorAll(CARD_SHORT_ID_SELECTOR).length > 0;
if (card.getAttribute('href') == undefined && !duplicateCheck) {
if (card && card.getAttribute('href') == undefined && !duplicateCheck) {
hrefReady(card).then(function(href) {
var cardTitle = card.innerHTML;
var shortId = document.createElement('span');
Expand Down

0 comments on commit 1e6bf89

Please sign in to comment.