Check for nil uri in addition to empty.