I don't see how the get_term() call could fail here, since we just checked/created it a few lines above:

https://github.com/coolamit/wp-term-management-tools/blob/c564b944fef51959448c3e6a1660a26d9ea16f0a/term-management-tools.php#L113-119