FIX: ensures chart parent element is still present before render (#8145)

FIX: ensures chart parent element is still present before render (#8145)

diff --git a/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6 b/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6
index ce0dfd9..852bc92 100644
--- a/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6
+++ b/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6
@@ -33,6 +33,10 @@ export default Ember.Component.extend({
 
   _scheduleChartRendering() {
     Ember.run.schedule("afterRender", () => {
+      if (!this.element) {
+        return;
+      }
+
       this._renderChart(
         this.model,
         this.element.querySelector(".chart-canvas")

GitHub sha: 91dd6aac

1 Like