mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-07-04 22:37:26 +00:00
[Fix] SettingProperties 修复在初次设置群组配置时未创建该群组所属Properties导致NPE的问题;
[Update] BotAdminCommandProcess 更新日志内容及命令返回信息; [Change] BotCommandProcess 调整配置项key格式;
This commit is contained in:
@ -186,7 +186,13 @@ public final class SettingProperties {
|
||||
*/
|
||||
public static String setProperty(long groupId, String key, String value) {
|
||||
Objects.requireNonNull(key);
|
||||
Properties targetProperties = groupId <= 0 ? globalProp : getGroupProperties(groupId);
|
||||
Properties targetProperties;
|
||||
if(groupId <= 0) {
|
||||
changeList.add(groupId);
|
||||
targetProperties = getGroupProperties(groupId);
|
||||
} else {
|
||||
targetProperties = globalProp;
|
||||
}
|
||||
String lastValue = targetProperties.getProperty(key);
|
||||
if(value != null) {
|
||||
targetProperties.setProperty(key, value);
|
||||
@ -214,6 +220,9 @@ public final class SettingProperties {
|
||||
if (groupId <= 0) {
|
||||
throw new IllegalArgumentException("Group number cannot be 0 or negative: " + groupId);
|
||||
}
|
||||
if(!groupPropMap.containsKey(groupId)) {
|
||||
groupPropMap.put(groupId, new Properties(globalProp));
|
||||
}
|
||||
return groupPropMap.get(groupId);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user