Skip to content

Commit

Permalink
Merge pull request pentaho#3383 from tkafalas/feature
Browse files Browse the repository at this point in the history
[BACKLOG-14161] Opening sample.ktr file in Spoon causes NPE because o…
  • Loading branch information
rmansoor authored Jan 17, 2017
2 parents b3289a4 + 7f13750 commit 3b4b2ca
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions engine/src/org/pentaho/di/trans/TransMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -3679,34 +3679,35 @@ public boolean hasChanged() {
}

private boolean isErrorNode( Node errorHandingNode, Node checkNode ) {
NodeList errors = errorHandingNode.getChildNodes();
if ( errorHandingNode != null ) {
NodeList errors = errorHandingNode.getChildNodes();

Node nodeHopFrom = XMLHandler.getSubNode( checkNode, TransHopMeta.XML_FROM_TAG );
Node nodeHopTo = XMLHandler.getSubNode( checkNode, TransHopMeta.XML_TO_TAG );
Node nodeHopFrom = XMLHandler.getSubNode( checkNode, TransHopMeta.XML_FROM_TAG );
Node nodeHopTo = XMLHandler.getSubNode( checkNode, TransHopMeta.XML_TO_TAG );

int i = 0;
while ( i < errors.getLength() ) {
int i = 0;
while ( i < errors.getLength() ) {

Node errorNode = errors.item( i );
Node errorNode = errors.item( i );

if ( !StepErrorMeta.XML_ERROR_TAG.equals( errorNode.getNodeName() ) ) {
i++;
continue;
}
if ( !StepErrorMeta.XML_ERROR_TAG.equals( errorNode.getNodeName() ) ) {
i++;
continue;
}

Node errorSourceNode = XMLHandler.getSubNode( errorNode, StepErrorMeta.XML_SOURCE_STEP_TAG );
Node errorTagetNode = XMLHandler.getSubNode( errorNode, StepErrorMeta.XML_TARGET_STEP_TAG );
Node errorSourceNode = XMLHandler.getSubNode( errorNode, StepErrorMeta.XML_SOURCE_STEP_TAG );
Node errorTagetNode = XMLHandler.getSubNode( errorNode, StepErrorMeta.XML_TARGET_STEP_TAG );

String sourceContent = errorSourceNode.getTextContent().trim();
String tagetContent = errorTagetNode.getTextContent().trim();
String sourceContent = errorSourceNode.getTextContent().trim();
String tagetContent = errorTagetNode.getTextContent().trim();

if ( sourceContent.equals( nodeHopFrom.getTextContent().trim() )
&& tagetContent.equals( nodeHopTo.getTextContent().trim() ) ) {
return true;
if ( sourceContent.equals( nodeHopFrom.getTextContent().trim() )
&& tagetContent.equals( nodeHopTo.getTextContent().trim() ) ) {
return true;
}
i++;
}
i++;
}

return false;
}

Expand Down

0 comments on commit 3b4b2ca

Please sign in to comment.