Fixed a bug in Web UI.

There was no check on the bounds of an array before attempting to read
it.

Review: https://reviews.apache.org/r/15640