diff --git a/src/main/gg/frog/mc/permissionstime/command/MeCmd.java b/src/main/gg/frog/mc/permissionstime/command/MeCmd.java index 6d7aa12..613a320 100644 --- a/src/main/gg/frog/mc/permissionstime/command/MeCmd.java +++ b/src/main/gg/frog/mc/permissionstime/command/MeCmd.java @@ -41,8 +41,10 @@ public class MeCmd implements Runnable { sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "=====你共有{0}种权限包=====", ps.size())); for (PlayerDataBean pdb : ps) { PermissionPackageBean pc = PackagesCfg.PACKAGES.get(pdb.getPackageName()); - String expireString = StrUtil.timestampToString(pdb.getExpire()); - sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "权限包: {0}({1}), 到期时间: {2}", pc.getDisplayName(), pdb.getPackageName(), expireString)); + if (pc != null) { + String expireString = StrUtil.timestampToString(pdb.getExpire()); + sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "权限包: {0}({1}), 到期时间: {2}", pc.getDisplayName(), pdb.getPackageName(), expireString)); + } } } else { sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "暂时无数据")); diff --git a/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java b/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java index b9fddb3..f3b4bd4 100644 --- a/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java +++ b/src/main/gg/frog/mc/permissionstime/model/cfg/PermissionPackageBean.java @@ -176,10 +176,12 @@ public class PermissionPackageBean implements IConfigBean { } } PermissionPackageBean p = PackagesCfg.PACKAGES.get(pdb.getPackageName()); - addPpb.getPermissions().addAll(p.getPermissions()); - subPpb.getPermissions().removeAll(p.getPermissions()); - addPpb.getGroups().addAll(p.getGroups()); - subPpb.getGroups().removeAll(p.getGroups()); + if (p != null) { + addPpb.getPermissions().addAll(p.getPermissions()); + subPpb.getPermissions().removeAll(p.getPermissions()); + addPpb.getGroups().addAll(p.getGroups()); + subPpb.getGroups().removeAll(p.getGroups()); + } } subPpb.clearPlayer(player, plugin.getServer(), plugin.getPermission()); addPpb.givePlayer(player, plugin.getServer(), plugin.getPermission());