Skip to content

Commit

Permalink
Avoid crashing if a checkbox isn't present anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
FdelMazo committed Apr 10, 2024
1 parent dadb941 commit e44ba95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ const Graph = (userContext) => {
};

const toggleCheckbox = (c) => {
if (!user.carrera.creditos.checkbox.find((ch) => ch.nombre === c)) {
return;
}

const value = !!user.carrera.creditos.checkbox.find((ch) => ch.nombre === c)
.check;
user.carrera.creditos.checkbox.find((ch) => ch.nombre === c).check = !value;
Expand Down

0 comments on commit e44ba95

Please sign in to comment.