removed unused code
null is of type of object. Check if null first