Fixed a bug in Web UI.

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