Fix NPE if url is null

Change-Id: Ibaf529530aea336a41b2e67d152fbc54e58b9072