fix nonetype has no attr text bug