JAL-4134 fix NPEs when matrix not resolved or alignment view is closed
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index e002999..52a6066 100755 (executable)
@@ -428,7 +428,7 @@ public class AnnotationLabels extends JPanel
       {
         final PAEContactMatrix cm = (PAEContactMatrix) av
                 .getContactMatrix(aa[selectedRow]);
-        if (cm.getNewick()!=null && cm.getNewick().length()>0)
+        if (cm!=null && cm.getNewick()!=null && cm.getNewick().length()>0)
         {
           item = new JMenuItem("Show Tree for Matrix");
           item.addActionListener(new ActionListener()