xiatian 1 rok pred
rodič
commit
f7dff6ac1d

+ 6 - 0
examcloud-core-questions-base/src/main/java/cn/com/qmth/examcloud/core/questions/base/word/DocxProcessUtil.java

@@ -496,12 +496,18 @@ public final class DocxProcessUtil {
 //    }
     
     public static String getTextInHtml(String htmlStr) {
+    	if(htmlStr==null) {
+    		return htmlStr;
+    	}
 		htmlStr = htmlStr.replaceAll("\\&[a-zA-Z]{1,10};", "").trim();
 
 		try {
 			org.jsoup.nodes.Document doc = Jsoup.parse(htmlStr);
 			StringBuilder textStr = new StringBuilder();
 			Elements links = doc.select("body");
+			if(links==null||links.size()==0) {
+				return htmlStr;
+			}
 			for (Node node : links.get(0).childNodes()) {
 				getTextByNode(textStr, node);
 			}