Skip to content

Commit

Permalink
Fix handling of CDDL extracts by expandSpecResult function (#1732)
Browse files Browse the repository at this point in the history
The `contents` variable needs to be defined before it gets used.
  • Loading branch information
tidoust authored Dec 17, 2024
1 parent 0bb9300 commit 4d6b414
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ async function expandSpecResult(spec, baseFolder, properties) {

// Treat CDDL extracts separately, one spec may have multiple CDDL
// extracts (actual treatment is similar to IDL extracts otherwise)
let contents = null;
if (property === 'cddl') {
if (!spec[property]) {
return;
Expand Down Expand Up @@ -833,7 +834,6 @@ async function expandSpecResult(spec, baseFolder, properties) {
!spec[property].match(/^[^\/]+\/[^\/]+\.(json|idl)$/)) {
return;
}
let contents = null;
if (baseFolder.startsWith('https:')) {
const url = (new URL(spec[property], baseFolder)).toString();
const response = await fetch(url, { nolog: true });
Expand Down

0 comments on commit 4d6b414

Please sign in to comment.