Fix exception when media.caption is None.