more defensive get_cached_payload function

@czue