Undefined Offset Error in Theme

Receiving the following error in logs: Notice: Undefined offset: 2 in my_custom_theme_preprocess_page() (line 157 of /home/sonsoutr/public_html/themes/my_custom_theme/my_custom_theme.theme). Trying to trace error to no avail so far. Below is the snippet of code referenced above. Any help would be greatly appreciated. Line 157 referenced above is bolded[…]