Community
Participate
Working Groups
Created attachment 213283 [details] Patch to avoid the NullPointerException Steps to reproduce the problem: 1) Create a bookmark folder structure, e.g. Folder a - Folder b - - Folder c - - - Folder (or Bookmark) d 2) Delete a folder that contains at least one subfolder which contains another folder or bookmark (Folder b or Folder a in the example above) 3) A confirmation message is shown. Note the order of the nodes listed. If the order is from leaf to selected node (d, c, b in the example above) there is no problem => create another example. Otherwise (e.g. ordered c, b, d) the problem can be reproduced => click "Yes" 4) The folder structure is deleted correctly, but a NullPointerException is thrown: ProcessingException[ProcessingStatus[ERROR code=0 Unexpected exception java.lang.NullPointerException]] at org.eclipse.scout.rt.client.ui.action.AbstractAction$P_UIFacade.fireActionFromUI(AbstractAction.java:605) at org.eclipse.scout.rt.ui.swing.action.SwingScoutAction$1.run(SwingScoutAction.java:146) at org.eclipse.scout.rt.ui.swing.concurrency.SwingScoutSynchronizer$1.runVoid(SwingScoutSynchronizer.java:66) at org.eclipse.scout.rt.client.ClientJob.runStatus(ClientJob.java:177) at org.eclipse.scout.rt.client.ClientJob.runTransactionWrapper(ClientJob.java:161) at org.eclipse.scout.rt.client.ClientJob.run(ClientJob.java:149) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: java.lang.NullPointerException at org.eclipse.scout.rt.client.ui.desktop.bookmark.AbstractBookmarkTreeField$FolderNode$DeleteMenu.execAction(AbstractBookmarkTreeField.java:657) at org.eclipse.scout.rt.client.ui.action.AbstractAction.doAction(AbstractAction.java:297) at org.eclipse.scout.rt.client.ui.action.AbstractAction$P_UIFacade.fireActionFromUI(AbstractAction.java:598) ... 6 more At AbstractBookmarkTreeField.java:657, getTree() returns null for one of the iterations in the for loop. When we use the local variable "tree" and do a null check after resolving the parent node at AbstractTree:1233, it works. See patch attached. This patch is probably more kind of a workaround, so maybe someone who is more familiar with those classes may provide a better solution.
patch applied and tested
Bugfixes shipped on Scout 3.7 branch