[bugfix] Check if $data is null

Solve problem with Entity Collection with translations.