JAL-3446 from JAL-3253-applet Tree Canvas bug fix
authorBobHanson <hansonr@stolaf.edu>
Tue, 9 Jun 2020 06:20:53 +0000 (01:20 -0500)
committerBobHanson <hansonr@stolaf.edu>
Tue, 9 Jun 2020 06:20:53 +0000 (01:20 -0500)
- was possible to right-click off the node to get a NullPointer
exception.

src/jalview/gui/TreeCanvas.java

index 29ba52b..e59dfcc 100755 (executable)
@@ -761,7 +761,9 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
      */
     if (e.isPopupTrigger())
     {
-      chooseSubtreeColour();
+      if (highlightNode != null) {
+        chooseSubtreeColour();
+      }
       e.consume(); // prevent mouseClicked happening
     }
   }