Skip to content

Commit

Permalink
Fix "Cannot read property '$context' of null" (#54)
Browse files Browse the repository at this point in the history
Since there is a possibility to get `label` as `null` it should be also filtered out from updating.
  • Loading branch information
pfrankov authored and simonbrunel committed Apr 28, 2018
1 parent f8a0293 commit b3e7564
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,10 @@ Chart.plugins.register({
update = updates[i];
if (update[1]) {
label = update[0][EXPANDO_KEY];
label.$context.active = (update[1] === 1);
label.update(label.$context);
if (label) {
label.$context.active = (update[1] === 1);
label.update(label.$context);
}
}
}

Expand Down

0 comments on commit b3e7564

Please sign in to comment.