Skip to content

Commit

Permalink
Fix undefined reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Svetomechc authored and benmccann committed Oct 3, 2019
1 parent 7543654 commit 7d43350
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ module.exports = function(Chart) {
}
},
destroy: function(chartInstance) {
var deregisterers = chartInstance.annotation.onDestroy;
while (deregisterers.length > 0) {
deregisterers.pop()();
if (chartInstance.annotation) {
var deregisterers = chartInstance.annotation.onDestroy;
while (deregisterers.length > 0) {
deregisterers.pop()();
}
}
}
};
Expand Down

0 comments on commit 7d43350

Please sign in to comment.