Pretend I'm a thicky. Is this guarding against the case where messages is None or some non-iterative value?