Fix crash when view index is not matched

Fix crash when view index is not matched