diff --git a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java index 1ea2a850189879ac5e7f366ad4c3897b487520ef..9e4406023df1cd8ede3269a5d5c5344c3c6db41c 100644 --- a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java +++ b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java @@ -635,14 +635,17 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController protected final void doClose(UserRequest ureq) { // Now try to go back to place that is attacked to (optional) root back business path - if (launchedFromPoint != null && StringHelper.containsNonWhitespace(launchedFromPoint.getBusinessPath())) { + if (launchedFromPoint != null && StringHelper.containsNonWhitespace(launchedFromPoint.getBusinessPath()) + && launchedFromPoint.getEntries() != null && launchedFromPoint.getEntries().size() > 0) { BusinessControl bc = BusinessControlFactory.getInstance().createFromPoint(launchedFromPoint); - WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl()); - try { - //make the resume secure. If something fail, don't generate a red screen - NewControllerFactory.getInstance().launch(ureq, bwControl); - } catch (Exception e) { - logError("Error while resuming with root leve back business path::" + launchedFromPoint.getBusinessPath(), e); + if(bc.hasContextEntry()) { + WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl()); + try { + //make the resume secure. If something fail, don't generate a red screen + NewControllerFactory.getInstance().launch(ureq, bwControl); + } catch (Exception e) { + logError("Error while resuming with root level back business path::" + launchedFromPoint.getBusinessPath(), e); + } } }