Bug fix  :Modified getLoopDirectionEnum

The null value check was being made for a local variable whose value was being set to null anyway. Modified that to the expression pointer that is being passed.