Skip to content

checkboxmanager.js getSelectedModIds fails when checkbox not found #136

@x-iy

Description

@x-iy

getSelectedModIds

There can be a situation where const checkbox = document.getElementById(sectionBoxes[sectionNumber][i].boxId); can return null resulting in error and blocking.

This can be fixed by checking for null:

const checkbox = document.getElementById(sectionBoxes[sectionNumber][i].boxId);
if (checkbox && checkbox.checked) {
    moduleIds.push(sectionBoxes[sectionNumber][i].moduleId);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions