Hello Felix, my code would return null currently for null value Objects.toString(vaoue) would return "null"
Am I missing something ? Thanks On Sat, Nov 10, 2018 at 1:06 PM Felix Schumacher < [email protected]> wrote: > > Am 10.11.18 um 12:21 schrieb [email protected]: > > Author: pmouawad > > Date: Sat Nov 10 11:21:56 2018 > > New Revision: 1846297 > > > > URL: http://svn.apache.org/viewvc?rev=1846297&view=rev > > Log: > > Bug 62900 - ObjectProperty#getStringValue() can throw > NullPointerException > > Bugzilla Id: 62900 > > > > Modified: > > > jmeter/trunk/src/core/org/apache/jmeter/testelement/property/ObjectProperty.java > > jmeter/trunk/xdocs/changes.xml > > > > Modified: > jmeter/trunk/src/core/org/apache/jmeter/testelement/property/ObjectProperty.java > > URL: > http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/ObjectProperty.java?rev=1846297&r1=1846296&r2=1846297&view=diff > > > ============================================================================== > > --- > jmeter/trunk/src/core/org/apache/jmeter/testelement/property/ObjectProperty.java > (original) > > +++ > jmeter/trunk/src/core/org/apache/jmeter/testelement/property/ObjectProperty.java > Sat Nov 10 11:21:56 2018 > > @@ -101,7 +101,11 @@ public class ObjectProperty extends Abst > > */ > > @Override > > public String getStringValue() { > > - return value.toString(); > > + if(value != null) { > > + return value.toString(); > > + } else { > > + return null; > > + } > > This could be shortened to Objects.toString(value) ;) > > Felix > > > } > > > > /** > > > > Modified: jmeter/trunk/xdocs/changes.xml > > URL: > http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1846297&r1=1846296&r2=1846297&view=diff > > > ============================================================================== > > --- jmeter/trunk/xdocs/changes.xml [utf-8] (original) > > +++ jmeter/trunk/xdocs/changes.xml [utf-8] Sat Nov 10 11:21:56 2018 > > @@ -197,6 +197,7 @@ of previous time slot as a base. Startin > > <li><bug>62795</bug>JMeter master sometimes ends distributed test > even though some of the slaves have not finished</li> > > <li><bug>62336</bug><pr>396</pr>Some shortcuts are not working > correctly on windows. Contributed by Michael Pavlov (michael.paulau at > gmail.com)</li> > > <li><bug>62889</bug>Format JSON Arrays when displayed with JSON > Path Tester.</li> > > + <li><bug>62900</bug>ObjectProperty#getStringValue() can throw > NullPointerException</li> > > </ul> > > > > <!-- =================== Thanks =================== --> > > > > > -- Cordialement. Philippe Mouawad.
