Code in Taglist not working

Once after I get the taglist, After satisfying the criteria, I need to execute the code in the else block. But it is not working if there are no tags. Even though there are no tags, the else code should be executed. Help needed