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 2008/08/14 23:52:48 UTC

svn commit: r686055 - /jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/Property.java

Author: sebb
Date: Thu Aug 14 14:52:48 2008
New Revision: 686055

URL: http://svn.apache.org/viewvc?rev=686055&view=rev
Log:
Avoid possible NPE (if property used on Test Plan)

Modified:
    jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/Property.java

Modified: jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/Property.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/Property.java?rev=686055&r1=686054&r2=686055&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/Property.java (original)
+++ jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/Property.java Thu Aug 14 14:52:48 2008
@@ -26,6 +26,7 @@
 import org.apache.jmeter.engine.util.CompoundVariable;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.samplers.Sampler;
+import org.apache.jmeter.threads.JMeterVariables;
 import org.apache.jmeter.util.JMeterUtils;
 
 /**
@@ -80,7 +81,10 @@
         if (values.length > 1) {
             String variableName = ((CompoundVariable) values[1]).execute();
             if (variableName.length() > 0) {// Allow for empty name
-                getVariables().put(variableName, propertyValue);
+                final JMeterVariables variables = getVariables();
+                if (variables != null) {
+                    variables.put(variableName, propertyValue);
+                }
             }
         }
         return propertyValue;



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