anchor.diff:      _chartController.setupData();
   
       // Monitor heap samples.
  -    addAutoDisposeListener(_memoryTimeline.sampleAddedNotifier, () {
  -      setState(() {
  -        _processHeapSample(_memoryTimeline.sampleAddedNotifier.value);
  +    if (_memoryTimeline.sampleAddedNotifier.value != null) {
  +      addAutoDisposeListener(_memoryTimeline.sampleAddedNotifier, () {
  +        setState(() {
  +          _processHeapSample(_memoryTimeline.sampleAddedNotifier.value!);
  +        });
         });
  -    });
  +    }
  +
       // Monitor event fired.
       addAutoDisposeListener(_memoryTimeline.eventNotifier, () {
         setState(() {
  
positive.code:     final monitorResetIndex = _chartController.createTrace(
        trace.ChartType.symbol,
        trace.PaintCharacteristics.concentric(
          color: Colors.grey[600],
          strokeWidth: 4,
          diameter: 6,
          fixedMinY: visibleVmEvent,
  
negative.code: // Copyright 2020 The Chromium Authors. All rights reserved.
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  import 'package:devtools_shared/devtools_shared.dart';
  import 'package:flutter/material.dart';
  