This was the other bug. `state.get_consumption()` was `None` and this wasn't checked for.