Check for not null and is entry_id set

Added check for `null` or `$entry_id` being set in `$group` array