🐛 #3700 修复空指针问题
Some checks failed
Publish to Maven Central / build-and-publish (push) Has been cancelled

This commit is contained in:
Copilot
2025-11-15 17:14:45 +08:00
committed by GitHub
parent 092e992817
commit 76c7e994a5

View File

@@ -299,7 +299,9 @@ public class WxOpenXmlMessage implements Serializable {
public static WxOpenXmlMessage fromXml(String xml) {
//修改微信变态的消息内容格式,方便解析
if (xml != null) {
xml = xml.replace("</PicList><PicList>", "");
}
return XStreamTransformer.fromXml(WxOpenXmlMessage.class, xml);
}
@@ -321,6 +323,11 @@ public class WxOpenXmlMessage implements Serializable {
WxOpenCryptUtil cryptUtil = new WxOpenCryptUtil(wxOpenConfigStorage);
String plainText = cryptUtil.decryptXml(msgSignature, timestamp, nonce, encryptedXml);
log.debug("解密后的原始xml消息内容{}", plainText);
if (plainText == null || plainText.trim().isEmpty()) {
throw new WxRuntimeException("解密后的xml消息内容为空请检查加密参数是否正确");
}
WxOpenXmlMessage wxOpenXmlMessage = fromXml(plainText);
wxOpenXmlMessage.setContext(plainText);
return wxOpenXmlMessage;