Skip to content

Commit 996fa4f

Browse files
Just initialize in constructor to avoid NPE
1 parent 0390d75 commit 996fa4f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

freeplane_plugin_codeexplorer/src/main/java/org/freeplane/plugin/codeexplorer/map/CodeMapPersistenceManager.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ public void restoreUserContent(CodeMap map) {
5959
.entrySet().stream()
6060
.forEach(content -> addToMap(map, content.getKey(), content.getValue()));
6161
final String attributeViewType = configuration.getAttributeConfiguration().getAttributeViewType();
62-
if(attributeViewType != null)
63-
AttributeRegistry.getRegistry(map).setAttributeViewType(attributeViewType);
62+
AttributeRegistry.getRegistry(map).setAttributeViewType(attributeViewType);
6463

6564
} else {
6665
AttributeRegistry.getRegistry(map).setAttributeViewType(AttributeTableLayoutModel.HIDE_ALL);

freeplane_plugin_codeexplorer/src/main/java/org/freeplane/plugin/codeexplorer/task/CodeAttributeConfiguration.java

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ public class CodeAttributeConfiguration {
1313
@SerializedName("attributeViewType")
1414
private String attributeViewType;
1515

16+
public CodeAttributeConfiguration() {
17+
super();
18+
this.attributeViewType = AttributeTableLayoutModel.HIDE_ALL;
19+
}
20+
1621
void initialize() {
1722
if(attributeViewType == null)
1823
attributeViewType = AttributeTableLayoutModel.HIDE_ALL;

0 commit comments

Comments
 (0)