I would be following more defensive approach. See below:
try
{
lines2 = ResultViewshown2[i].Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);
for (int x = 0; x < lines2.length; x++)
{
string line = lines2[x];
if(!string.IsNullOrEmpty(line))
{
if (!line.Contains(check2))
{
Resultadd2.Add((string.Format("{0}\r\n", line ?? string.Empty)));
}
}
}
}
catch(IndexOutOfRangeException)
{
}