Fix null pointer consideration for linked ids