jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject [jmeter] branch master updated: AbstractJMeterGuiComponent: Fix NPE in Nimbus LAF and add comment as per Vladimir comment
Date Sun, 13 Oct 2019 13:13:32 GMT
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 560b5ca  AbstractJMeterGuiComponent: Fix NPE in Nimbus LAF and add comment as per
Vladimir comment
560b5ca is described below

commit 560b5cab8dec47f4c4b41fe3a1bd2fe7aae72d19
Author: pmouawad <p.mouawad@ubik-ingenierie.com>
AuthorDate: Sun Oct 13 15:13:17 2019 +0200

    AbstractJMeterGuiComponent: Fix NPE in Nimbus LAF and add comment as per
    Vladimir comment
---
 .../main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
b/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
index 22416cc..4c2b95d 100644
--- a/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
+++ b/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
@@ -139,7 +139,11 @@ public abstract class AbstractJMeterGuiComponent extends JPanel implements
JMete
      */
     @Override
     public String getName() {
-        return namePanel.getName(); // $NON-NLS-1$
+        if (getNamePanel() != null) { // Check is mandatory because some LAFs (Nimbus) call
getName() from 
+                                      // super constructor (so can happen before namePanel
field is initialized
+            return getNamePanel().getName();
+        }
+        return ""; // $NON-NLS-1$
     }
 
     /**


Mime
View raw message