Revert "fix: check first if object is null"

This reverts commit 84ce1dbaa649402728adf701b63d4f49f593b957.