Revert "[bugfix] Check if $data is null"

This reverts commit 17747d0d2351ea2c93c7dd660d1e256c70079a50.