Barnard is correct that full error trace back is needed, but you are saying if it equals change color one way, else set color another way. Is it possible a none type value is making it to the else clause.