Null variable doesn't give error when trying to use as array