Added assert statement for checking null data variable when initializing

Sometimes people make a mistake that is initializing Mat object with external data variable actually null.
It is helpful to check if data is null before creating Mat object.