Fix EZP-20949: Make sure parent is an object

# Description
The customer had an issue that we couldn't reproduce. The database was
probably corrupted. This patch has been provided to insure the parent was
an object to avoid fatal errors.