Skip to content
Snippets Groups Projects
Commit 145a2e28 authored by srosse's avatar srosse
Browse files

OO-3026: check if the node exists in the catalog activation method

parent ca81a3d2
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,7 @@ public class CatalogManagerController extends BasicController implements Activat ...@@ -85,7 +85,7 @@ public class CatalogManagerController extends BasicController implements Activat
Long entryKey = entry.getOLATResourceable().getResourceableId(); Long entryKey = entry.getOLATResourceable().getResourceableId();
if(entryKey != null && entryKey.longValue() > 0) { if(entryKey != null && entryKey.longValue() > 0) {
List<ContextEntry> parentLine = new ArrayList<>(); List<ContextEntry> parentLine = new ArrayList<>();
for(CatalogEntry node = catalogManager.getCatalogEntryByKey(entryKey); node.getParent() != null; node=node.getParent()) { for(CatalogEntry node = catalogManager.getCatalogEntryByKey(entryKey); node != null && node.getParent() != null; node=node.getParent()) {
OLATResourceable nodeRes = OresHelper.createOLATResourceableInstance("Node", node.getKey()); OLATResourceable nodeRes = OresHelper.createOLATResourceableInstance("Node", node.getKey());
ContextEntry ctxEntry = BusinessControlFactory.getInstance().createContextEntry(nodeRes); ContextEntry ctxEntry = BusinessControlFactory.getInstance().createContextEntry(nodeRes);
ctxEntry.setTransientState(new CatalogStateEntry(node)); ctxEntry.setTransientState(new CatalogStateEntry(node));
......
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