at the moment you need:

if(ent != NULL)
{
if(is(ent, SHOW))
{ [...] }
}

and we want:

if(ent != NULL /*if here this is already wrong, and the && follows, just stop*/ && is(ent, SHOW))
{
[..]
}