Fix PHP warning in posts with no relations