Could also write this as:
```
Option(context.taskMetrics).foreach{ metrics => 
  metrics.updatedBlocks = Some(updatedBlocks)
}
```
Not sure it's any nicer though :)