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

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new 1a0f3e987e Fix NPE when editing unit test without selecting any unit 
test (#6389)
1a0f3e987e is described below

commit 1a0f3e987e0a916a611fc044028f30184e8b2e0e
Author: lance <[email protected]>
AuthorDate: Thu Jan 15 18:27:08 2026 +0800

    Fix NPE when editing unit test without selecting any unit test (#6389)
    
    Signed-off-by: lance <[email protected]>
---
 .../main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java
 
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java
index 709f22dfaf..c6ae88037e 100644
--- 
a/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java
+++ 
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/gui/TestingGuiPlugin.java
@@ -900,7 +900,9 @@ public class TestingGuiPlugin {
             hopGui.getMetadataProvider(),
             PipelineUnitTest.class,
             hopGui.getShell());
-    if (manager.editMetadata(unitTest.getName())) {
+    if (unitTest != null
+        && !Utils.isEmpty(unitTest.getName())
+        && manager.editMetadata(unitTest.getName())) {
       // Activate the test
       refreshUnitTestsList();
       selectUnitTest(pipelineMeta, unitTest);
@@ -1292,6 +1294,9 @@ public class TestingGuiPlugin {
 
     try {
       PipelineUnitTest unitTest = getUnitTestFromContext(context);
+      if (unitTest == null) {
+        return;
+      }
       PipelineUnitTestTweak unitTestTweak = 
unitTest.findTweak(transformMeta.getName());
       if (unitTestTweak != null) {
         unitTest.getTweaks().remove(unitTestTweak);
@@ -1401,7 +1406,7 @@ public class TestingGuiPlugin {
   public void switchUnitTest(PipelineUnitTest targetTest, PipelineMeta 
pipelineMeta) {
     try {
       TestingGuiPlugin.getInstance().detachUnitTest();
-      TestingGuiPlugin.getInstance().selectUnitTest(pipelineMeta, targetTest);
+      TestingGuiPlugin.selectUnitTest(pipelineMeta, targetTest);
     } catch (Exception exception) {
       new ErrorDialog(
           HopGui.getInstance().getShell(),

Reply via email to