Avoid raising index error when no host

Strings like 'http://' are not correctly parsing
due to an index error raised when the first element
of the address is parsed (which is empty). Avoid this
by first checking if the address is non-empty before
doing work on it.

Change-Id: Ic50c9b31083dea82d068423f6809ec13c85da00a
Merge "Avoid raising index error when no host"