add more safe guards for empty payloads

related to #90