Guard against uninitialized chart variable

Change-Id: I52856d3a431e0ab7a863ed2ed1b447623d16c4bc
diff --git a/tools/perf/index.html b/tools/perf/index.html
index 5d5f6f6..ec09f14 100644
--- a/tools/perf/index.html
+++ b/tools/perf/index.html
@@ -211,7 +211,11 @@
             yAxisID: 'y2',
             segment: {
               borderColor: ctx =>
-                  skipped(ctx, myChart.data.datasets[ctx.datasetIndex].backgroundColor),
+                  skipped(
+                      ctx,
+                      myChart
+                          ? myChart.data.datasets[ctx.datasetIndex].backgroundColor
+                          : undefined),
               borderDash: ctx => skipped(ctx, [6, 6]),
             },
             spanGaps: true