Fix data cast of null pointer