You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2004/02/22 20:30:13 UTC

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/gui GuiPackage.java

sebb        2004/02/22 11:30:13

  Modified:    src/core/org/apache/jmeter/gui GuiPackage.java
  Log:
  Fix NPE on headless systems
  
  Revision  Changes    Path
  1.33      +12 -6     jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java
  
  Index: GuiPackage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- GuiPackage.java	20 Feb 2004 02:35:45 -0000	1.32
  +++ GuiPackage.java	22 Feb 2004 19:30:13 -0000	1.33
  @@ -621,9 +621,15 @@
           // EditCommand action -- we can't just trigger the action because that
           // would populate the current node with the contents of the new GUI --
           // which is empty.]
  -        getMainFrame().setMainPanel(
  -            (javax.swing.JComponent) getCurrentGui());
  -        getMainFrame().setEditMenu(getTreeListener().getCurrentNode()
  -                .createPopupMenu());
  +        MainFrame mf = getMainFrame(); // Fetch once
  +        if (mf == null) //Probably caused by unit testing on headless system
  +        {
  +        	log.warn("Mainframe is null");
  +        }
  +        else
  +        {
  +        	mf.setMainPanel((javax.swing.JComponent) getCurrentGui());
  +        	mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
  +        }
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org