Fix EZP-20949: Make sure parent is an object

# Description
This patch insures the parent was an object to avoid fatal errors if
the database is slighly corrupted.