Get_terms stopped working after WP 4.2

I’ve got this fixed now. Managed to talk with my old developer and he added this:

$termsById = array();
foreach ($terms as $t) {
    $termsById[$t->term_id] = $t;
}

I had to add this new variable where $terms was previously used on line 14.

Thanks for your help everyone, I appreciate the effort.