From ae03daf9a91d8a6b751874660c721084782fac8f Mon Sep 17 00:00:00 2001 From: Lahiru Madushanka Date: Tue, 11 Jun 2024 10:01:01 +0530 Subject: [PATCH] Fix NPE in synapse unit tests. Fix NPE in synapse unit testsFix NPE in synapse unit tests. --- .../org/apache/synapse/unittest/SynapseTestcaseDataReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/main/java/org/apache/synapse/unittest/SynapseTestcaseDataReader.java b/modules/core/src/main/java/org/apache/synapse/unittest/SynapseTestcaseDataReader.java index 5a4329c903..faddf9d260 100755 --- a/modules/core/src/main/java/org/apache/synapse/unittest/SynapseTestcaseDataReader.java +++ b/modules/core/src/main/java/org/apache/synapse/unittest/SynapseTestcaseDataReader.java @@ -259,7 +259,7 @@ ArtifactData readAndStoreArtifactData() throws XMLStreamException, IOException { QName qualifiedRegistryArtifactFile = new QName("", ARTIFACT, ""); OMElement registryArtifactsFileNode = resource.getFirstChildWithName(qualifiedRegistryArtifactFile); String resourceArtifact = registryArtifactsFileNode.getText(); - if (resourceArtifact.isEmpty()) { + if (resourceArtifact.isEmpty() && registryArtifactsFileNode.getFirstOMChild() != null) { resourceArtifact = registryArtifactsFileNode.getFirstOMChild().toString(); }