fix: 修复 ShareLinkInfo.getCacheKey() 中 otherParam.get("UA") 可能导致的 NPE

This commit is contained in:
yukaidi
2026-05-29 02:36:20 +08:00
parent 46b2eb1ccd
commit c0b18be5ab

View File

@@ -86,7 +86,10 @@ public class ShareLinkInfo {
// 将type和shareKey组合成一个字符串作为缓存key
String key = type + ":" + shareKey;
if (type.equals("p115")) {
key += ("_" + otherParam.get("UA").toString().hashCode());
Object ua = otherParam != null ? otherParam.get("UA") : null;
if (ua != null) {
key += ("_" + ua.toString().hashCode());
}
}
return key;
}