提交 da1c54f4 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Fix the showCondition could be null

上级 a382eb81
...@@ -38,6 +38,11 @@ public class CommunityDecorator extends PageDecorator { ...@@ -38,6 +38,11 @@ public class CommunityDecorator extends PageDecorator {
} }
String conditionName = communityProperty.getShowCondition(); String conditionName = communityProperty.getShowCondition();
if(conditionName == null) {
// when this plugin just be installed without restart, could be under this situation
return isCurrentLanguage;
}
UserCommunityProperty.ShowConditions condition = UserCommunityProperty.ShowConditions condition =
UserCommunityProperty.ShowConditions.valueOf(conditionName); UserCommunityProperty.ShowConditions.valueOf(conditionName);
switch (condition) { switch (condition) {
......
...@@ -10,7 +10,7 @@ import org.kohsuke.stapler.DataBoundSetter; ...@@ -10,7 +10,7 @@ import org.kohsuke.stapler.DataBoundSetter;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class UserCommunityProperty extends UserProperty { public class UserCommunityProperty extends UserProperty {
private String showCondition; private String showCondition = ShowConditions.Chinese.name();
@DataBoundConstructor @DataBoundConstructor
public UserCommunityProperty(){} public UserCommunityProperty(){}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册