Fix notice when deleting last record

When deleting the last record for a given foreign key, the $results (sum in my example) would be completely empty as there were no records to sum.
Merge pull request #1 from Ali1/master

Fix for instances where records do not exist and field value is not returned.