chore(views): moved check to avoid an array index warning
Merge pull request #6562 from sembrestels/warning-array-index

chore(views): moved check to avoid an array index warning