JAL-1753 declare field with interface type; check for null dereference
[jalview.git] / src / jalview / gui / ProgressBar.java
index 8ebc98d..5307f26 100644 (file)
@@ -1,6 +1,7 @@
 package jalview.gui;
 
 import java.awt.BorderLayout;
+import java.awt.Component;
 import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -148,7 +149,11 @@ public class ProgressBar implements IProgressIndicator
     /*
      * lay out progress bar container hierarchy
      */
-    SwingUtilities.getRoot(statusPanel).validate();
+    Component root = SwingUtilities.getRoot(statusPanel);
+    if (root != null)
+    {
+      root.validate();
+    }
   }
 
   /**