Adding validation when source object is null

* Changing "def" with "Object"
* Tests are missing, but i am goung to add them on next commit"