setLocation (null check modified)