WebSearch: fix IndexError in is_hosted_collection

* Fixes possible IndexError situations in is_hosted_collection().
  (closes #1764)

Reviewed-by: Tibor Simko <tibor.simko@cern.ch>