Your code will be something like
someObj.aDataSort
and "someObj" is null or "undefined". We can't possibly say why that is given we can't see your code, but the solution is to fix your code so that "someObj" has a value, or change the code to work if it is undefined, whatever matches your needs.