Skip to content

Commit

Permalink
WFCORE-626 Global list-get operation can inadvertently create list el…
Browse files Browse the repository at this point in the history
…ements
  • Loading branch information
pferraro committed Apr 6, 2015
1 parent 55337de commit 80a3025
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ private ListGetHandler() {

void updateModel(final OperationContext context, ModelNode model, ListAttributeDefinition attributeDefinition, ModelNode listAttribute) throws OperationFailedException {
int index = INDEX.resolveModelAttribute(context, model).asInt();
context.getResult().set(listAttribute.get(index));
if (listAttribute.hasDefined(index)) {
context.getResult().set(listAttribute.get(index));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ private MapGetHandler() {

void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException {
String key = KEY.resolveModelAttribute(context, model).asString();
context.getResult().set(attribute.get(key));
if (attribute.hasDefined(key)) {
context.getResult().set(attribute.get(key));
}
}
}

Expand Down

0 comments on commit 80a3025

Please sign in to comment.