You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2019/11/11 18:00:14 UTC

[jmeter] branch master updated: ErrorMetric: test for nullity of responseMessage as it may be null

This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new d763e53  ErrorMetric: test for nullity of responseMessage as it may be null
d763e53 is described below

commit d763e53d5c230502b65addb96b758460c8126280
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Nov 11 19:01:08 2019 +0100

    ErrorMetric: test for nullity of responseMessage as it may be null
    
    This resolves Bug 63906 - NPE for InfluxDB backend listener during
    failover testing
---
 .../main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java    | 2 +-
 src/core/src/main/java/org/apache/jmeter/samplers/SampleResult.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/components/src/main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java b/src/components/src/main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java
index 67fe502..48e02e8 100644
--- a/src/components/src/main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java
+++ b/src/components/src/main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java
@@ -68,7 +68,7 @@ public class ErrorMetric {
      * @return the response message, 'none' if the code is empty
      */
     public String getResponseMessage() {
-        if (responseMessage.isEmpty()) {
+        if (responseMessage == null || responseMessage.isEmpty()) {
             return "None";
         } else {
             return responseMessage.trim();
diff --git a/src/core/src/main/java/org/apache/jmeter/samplers/SampleResult.java b/src/core/src/main/java/org/apache/jmeter/samplers/SampleResult.java
index 6c87bed..397a7b7 100644
--- a/src/core/src/main/java/org/apache/jmeter/samplers/SampleResult.java
+++ b/src/core/src/main/java/org/apache/jmeter/samplers/SampleResult.java
@@ -1582,7 +1582,7 @@ public class SampleResult implements Serializable, Cloneable, Searchable {
     }
 
     /**
-     * @return String first non null assertion failure message
+     * @return String first non null assertion failure message if assertionResults is not null, null otherwise
      */
     public String getFirstAssertionFailureMessage() {
         String message = null;