From a94dfa9f71fb78713471e991637876c08a6c9499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= <2450572350@qq.com> Date: Fri, 2 Jun 2023 09:48:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=A4=E6=96=AD,=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E6=8A=9B=E5=87=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/example/wxhk/msg/WxMsgHandle.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java b/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java index 8eccec9..b43769b 100644 --- a/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java +++ b/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java @@ -206,7 +206,11 @@ public class WxMsgHandle { try { String content = chatMsg.getContent(); Document document = XmlUtil.parseXml(content); - Node paysubtype = document.getElementsByTagName("paysubtype").item(0); + NodeList paysubtype1 = document.getElementsByTagName("paysubtype"); + if(paysubtype1.getLength()==0){ + return true; + } + Node paysubtype = paysubtype1.item(0); if ("1".equals(paysubtype.getTextContent().trim())) { // 手机发出去的 String textContent = document.getElementsByTagName("receiver_username").item(0).getTextContent();