Can't this code live inside the `try`, so `channel` can be a `val` and we don't have to do the `null` set/check thing?