avoid NullPointerException in StringUtil