Move location!=null check