Properly handle null URIs.

Change-Id: Ib81044686f40284bacf6ee645c671679f62be843