Fix crash in tests when array elem missing

Change-Id: I3f6480dade866d8e70b26297b77ad8249353cfe7
Merge "Fix crash in tests when array elem missing"