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