Fix EZP-23499: Fatal error removing class with unexistant datatype.

JIRA: https://jira.ez.no/browse/EZP-23499

This prevents a PHP fatal error when removing a class (contentType) if a datatype has been removed.
Instead, it is logged to error.log

There should be an error logged when `$dataType` is `null`, similarly to the change you made below.