Question: Run loop for valid inputs

here is my code i want to run the loop for every value if there is invalid input in lhs(ans(1)) the loop should not stop and check for next value
> restart;
>
> f1 := proc (x) options operator, arrow; R*T*(x*ln(x)+(1-x)*ln(1-x))+Omega[l]*x*(1-x) end proc;
x -> R T (x ln(x) + (1 - x) ln(1 - x)) + Omega[l] x (1 - x)
>
> g1 := proc (x) options operator, arrow; (1-x)*SfA*(T-TfA)+x*SfB*(T-TfB)+R*T*(x*ln(x)+(1-x)*ln(1-x))+Omega[s]*x*(1-x) end proc;
x -> (1 - x) SfA (T - TfA) + x SfB (T - TfB)

+ R T (x ln(x) + (1 - x) ln(1 - x)) + Omega[s] x (1 - x)
> TfA := 800; TfB := 1200; SfA := 10; SfB := 10; R := 8.3; Omega[l] := 0; Omega[s] := 0;
800
1200
10
10
8.3
0
0
> f1(x);
8.3 T (x ln(x) + (1 - x) ln(1 - x))
> g1(x);
10 (1 - x) (T - 800) + 10 x (T - 1200) + 8.3 T (x ln(x) + (1 - x) ln(1 - x))
> with(plots);
> equ1 := (f1(x1)-g1(x2))/(x1-x2) = diff(f1(x1), x1);
> equ2 := (f1(x1)-g1(x2))/(x1-x2) = diff(g1(x2), x2);
> B := array(810 .. 1199);

> C := array(810 .. 1199);

> A := array(810 .. 1199);

> for i from 755 by 1 to 1199do ;
> T := i;
> ans:=fsolve({equ1,equ2},{x1=0.00001,x2=0.01}): if type(ans,NULL)then;
> if lhs(ans(1)) = 'x1' then x1t := rhs(ans(1)); x2t := rhs(ans(2)) else x1t := rhs(ans(2)); x2t := rhs(ans(1)) end if;
> tg(i):=((f1(x1t)-g1(x2t))/(x1t-x2t))*(x-x1t)+f1(x1t): f(i):=8.3 i (x ln(x)+(1-x) ln(1-x))-15000 x (1-x):g(i):=10 (1-x) (i-800)+10 x (i-1200)+8.3 i (x ln(x)+(1-x) ln(1-x))+15000 x (1-x); B[i]:=tg(i); A[i]:=plot([[x1t,T]],style=point): C[i]:=plot([[x2t,T]],style=point): end if;
> end do;
Please Wait...