Skip to content

Commit

Permalink
Fixed NPE in resource list + in RW.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed May 27, 2016
1 parent 84a96e0 commit de42e95
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Expand Up @@ -62,6 +62,7 @@
import org.apache.wicket.resource.CoreLibrariesContributor;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.util.string.StringValue;
import org.jetbrains.annotations.NotNull;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

Expand Down Expand Up @@ -712,6 +713,7 @@ public StringResourceModel createStringResource(Enum e) {
return createStringResource(resourceKey);
}

@NotNull
public static StringResourceModel createStringResourceStatic(Component component, String resourceKey,
Object... objects) {
return new StringResourceModel(resourceKey, component).setModel(new Model<String>())
Expand Down
Expand Up @@ -103,13 +103,13 @@ private String getItemDefinitionName(ItemDefinition def) {
return null;
}

StringResourceModel nameModel = PageBase.createStringResourceStatic(null, def.getDisplayName());
if (nameModel != null){
if (StringUtils.isNotEmpty(nameModel.getString())) {
return nameModel.getString();
}
}
String name = def.getDisplayName();
if (def.getDisplayName() != null) {
StringResourceModel nameModel = PageBase.createStringResourceStatic(null, def.getDisplayName());
if (StringUtils.isNotEmpty(nameModel.getString())) {
return nameModel.getString();
}
}
String name = def.getDisplayName(); // TODO this is always null here, isn't it?
if (StringUtils.isEmpty(name)) {
name = def.getName().getLocalPart();
}
Expand Down
Expand Up @@ -201,7 +201,7 @@ public MappingType prepareDtoToSave(PrismContext prismContext) throws SchemaExce
}

if(condition != null){
if(mappingObject.getCondition() != null){
if (mappingObject.getCondition() == null) {
mappingObject.setCondition(new ExpressionType());
}

Expand Down

0 comments on commit de42e95

Please sign in to comment.