jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1783504 - /jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
Date Sat, 18 Feb 2017 11:06:19 GMT
Author: fschumacher
Date: Sat Feb 18 11:06:19 2017
New Revision: 1783504

URL: http://svn.apache.org/viewvc?rev=1783504&view=rev
Log:
Guard against NPE, as getGui can return null.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java?rev=1783504&r1=1783503&r2=1783504&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java Sat Feb 18 11:06:19 2017
@@ -274,6 +274,10 @@ public final class GuiPackage implements
             updateCurrentNode();
             TestElement curNode = treeListener.getCurrentNode().getTestElement();
             JMeterGUIComponent comp = getGui(curNode);
+            if (comp == null) {
+                log.debug("No Component found for {}.", treeListener.getCurrentNode().getName());
+                return null;
+            }
             comp.clearGui();
             log.debug("Updating gui to new node");
             comp.configure(curNode);
@@ -419,6 +423,10 @@ public final class GuiPackage implements
         currentNode = treeListener.getCurrentNode();
         TestElement element = currentNode.getTestElement();
         JMeterGUIComponent comp = getGui(element);
+        if (comp == null) {
+            log.debug("No component found for {}", currentNode.getName());
+            return;
+        }
         comp.configure(element);
         currentNodeUpdated = false;
     }
@@ -434,6 +442,10 @@ public final class GuiPackage implements
             if (currentNode != null && !currentNodeUpdated) {
                 log.debug("Updating current node " + currentNode.getName());
                 JMeterGUIComponent comp = getGui(currentNode.getTestElement());
+                if (comp == null) {
+                    log.debug("No component found for {}", currentNode.getName());
+                    return;
+                }
                 TestElement el = currentNode.getTestElement();
                 int before = 0;
                 int after = 0;



Mime
View raw message