Fail to refresh properly the Metric view of a Thread view when it has no metric values

Describe the bug

The viewer does not refresh Metric view properly

To Reproduce

  1. Open a database where a thread has no metric value
  2. Open a Metric view
  3. Open a Thread view of that empty thread
  4. Open another Thread view with metrics
  5. Close the Thread view
  6. An error message appears: "java.lang.NullPointerException: Cannot invoke "org.hpctoolkit.db.local.experiment.metric.IMetricManager.addMetricListener(java.beans.PropertyChangeListener)" because "metricManager" is null"

Platform (please complete the following information):

  • OS: [Linux, MacOS]
  • Architecture [x86, arm]
  • Version [main]