Skip to content

Commit

Permalink
additional error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgarrish committed May 15, 2024
1 parent 6dea4dc commit 56f1f36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,10 @@ KB.prototype.addTopicLinks = function() {

function findCategory(topic_list, id) {

if (!topic_list) {
return null;
}

for (var i = 0; i < topic_list.length; i++) {

if (topic_list[i].id == id) {
Expand Down Expand Up @@ -1327,7 +1331,7 @@ KB.prototype.generateWCAGLinks = function() {

function wcagLink(match, p1) {
if (!sc_map) {
return '<span class="wcag-level">[WCAG ' + p1 + ' - ' + sc_map[p1].level + ']</span>';
return '<span class="wcag-level">[WCAG ' + p1 + ']</span>';
}
else {
return '<span class="wcag-level">[<a href="/publishing/docs/wcag/' + sc_map[p1].id + '.html">WCAG ' + p1 + ' - ' + sc_map[p1].level + '</a>]</span>';
Expand Down

0 comments on commit 56f1f36

Please sign in to comment.