Fix bad class reporting when null is passed to validate

Passing a non-object to get_class() is forbidden, and passing null to it returns the object the method is called in :(
Merge branch 'feature/fix-entityrepository-classname-reporting' into develop