How to ignore error in if function

if type of last mem eq 'FBLI' or type of last mem eq 'ATTA' then

 

when the bran has no members... errror occurred...

here is full code

unenhance all
aid clear all

var !FILE    'D:\TEMP.TXT'




 openfile "$!FILE" write !INPUT
 handle ANY
 openfile "$!FILE" overwrite !INPUT
 endhandle


 var !COLL coll all bran for ce
 do !indx values !COLL
     $!indx
    var !href href
    var !tref tref
    var !hpos hpos
    var !tpos tpos

    if type of last mem eq 'FBLI' or type of last mem eq 'ATTA' or type of last mem eq 'CAP' then
        if (|$!href| eq |=0/0|) then
            !BRANNAME = !indx.dbref().name
        else
            !BRANNAME = ||
        endif

   
       
    else
        if (|$!href| neq |=0/0| and |$!tref| eq |=0/0|) then
            !BRANNAME = !indx.dbref().name
        elseif (|$!href| eq |=0/0| and |$!tref| neq |=0/0|) then
            !BRANNAME = !indx.dbref().name
        elseif (|$!href| eq |=0/0| and |$!tref| eq |=0/0|) then
            !BRANNAME = !indx.dbref().name
        elseif (|$!href| neq |=0/0| and |$!tref| neq |=0/0|) then
            !BRANNAME = ||
        endif
    endif
       


 writefile $!INPUT |$!BRANNAME|
 handle ANY
 endhandle
enddo


--!BRANNAME = Q ATT
 
 closefile $!INPUT
 syscom |D:\TEMP.TXT|