Fix EZP-20949: Make sure parent is an object
This patch insures the parent was an object to avoid fatal errors if
the database is slighly corrupted.