Skip to content
Snippets Groups Projects
Commit 30d0097b authored by uhensler's avatar uhensler
Browse files

OO-4167: NPE when creating a new linked list course element

parent 360d3c52
No related branches found
No related tags found
No related merge requests found
......@@ -72,23 +72,20 @@ public class LLCourseNode extends AbstractAccessableCourseNode {
public LLCourseNode(INode parent) {
super(TYPE, parent);
initDefaultConfig();
}
private void initDefaultConfig() {
@Override
public void updateModuleConfigDefaults(boolean isNewNode, INode parent) {
ModuleConfiguration config = getModuleConfiguration();
// add an empty link entry as default if none existent
if (config.get(CONF_LINKLIST) == null) {
if (isNewNode) {
List<LLModel> initialList = new ArrayList<>(1);
initialList.add(new LLModel());
config.set(CONF_LINKLIST, initialList);
}
}
@Override
public void updateModuleConfigDefaults(boolean isNewNode, INode parent) {
ModuleConfiguration config = getModuleConfiguration();
if(config.getConfigurationVersion() < 2) {
@SuppressWarnings("unchecked")
List<LLModel> links = (List<LLModel>)config.get(CONF_LINKLIST);
for(LLModel link:links) {
String linkValue = link.getTarget();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment