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

OO-2261: hardened nearest section method against tree without selected node

parent e0be24a5
No related branches found
No related tags found
No related merge requests found
...@@ -854,6 +854,9 @@ public class AssessmentTestComposerController extends MainLayoutBasicController ...@@ -854,6 +854,9 @@ public class AssessmentTestComposerController extends MainLayoutBasicController
} }
private TreeNode getNearestSection(TreeNode node) { private TreeNode getNearestSection(TreeNode node) {
if(node == null) {
node = menuTree.getTreeModel().getRootNode();
}
if(node.getUserObject() instanceof AssessmentTest) { if(node.getUserObject() instanceof AssessmentTest) {
//choose the first test part or section //choose the first test part or section
if(node.getChildCount() > 0) { if(node.getChildCount() > 0) {
......
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