ui: fix an array access derp

Fixes #1899.