Catch potential NoneType exception