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

OO-4582: check the life cycle is populated

parent c2fe02df
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,11 @@ public class ConditionPassedEvaluator implements PassedEvaluator { ...@@ -81,7 +81,11 @@ public class ConditionPassedEvaluator implements PassedEvaluator {
private RepositoryEntryLifecycle getRepositoryEntryLifecycle(RepositoryEntry courseEntry) { private RepositoryEntryLifecycle getRepositoryEntryLifecycle(RepositoryEntry courseEntry) {
try { try {
return courseEntry.getLifecycle(); RepositoryEntryLifecycle lifecycle = courseEntry.getLifecycle();
if(lifecycle != null) {
lifecycle.getValidTo();
}
return lifecycle;
} catch (LazyInitializationException e) { } catch (LazyInitializationException e) {
RepositoryEntry reloadedEntry = CoreSpringFactory.getImpl(RepositoryService.class) RepositoryEntry reloadedEntry = CoreSpringFactory.getImpl(RepositoryService.class)
.loadByKey(courseEntry.getKey()); .loadByKey(courseEntry.getKey());
......
...@@ -155,6 +155,9 @@ public class STRootPassedEvaluator implements RootPassedEvaluator { ...@@ -155,6 +155,9 @@ public class STRootPassedEvaluator implements RootPassedEvaluator {
if (courseEntry != null) { if (courseEntry != null) {
try { try {
lifecycle = courseEntry.getLifecycle(); lifecycle = courseEntry.getLifecycle();
if(lifecycle != null) {
lifecycle.getValidTo();
}
} catch (LazyInitializationException lie) { } catch (LazyInitializationException lie) {
RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class); RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
RepositoryEntry repositoryEntry = repositoryService.loadByKey(courseEntry.getKey()); RepositoryEntry repositoryEntry = repositoryService.loadByKey(courseEntry.getKey());
......
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