Skip to content

Commit

Permalink
Fix NPE when assigning/unassigning (MID-5027)
Browse files Browse the repository at this point in the history
When creating objects it is strongly advised to provide prismContext
e.g. using the constructor parameter.
  • Loading branch information
mederly committed Dec 13, 2018
1 parent 47b595b commit 5073ea8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -573,7 +573,7 @@ public static <T extends ObjectType> QName classToQName(PrismContext prismContex
public static TaskType createSingleRecurrenceTask(String taskName, QName applicableType, ObjectQuery query,
ObjectDelta delta, ModelExecuteOptions options, String category, PageBase pageBase) throws SchemaException {

TaskType task = new TaskType();
TaskType task = new TaskType(pageBase.getPrismContext());

MidPointPrincipal owner = SecurityUtils.getPrincipalUser();

Expand Down
Expand Up @@ -413,7 +413,7 @@ public void onClick(AjaxRequestTarget target) {
}

private void newTaskPerformed(String category, AjaxRequestTarget target) {
TaskType taskType = new TaskType();
TaskType taskType = new TaskType(getPageBase().getPrismContext());
PrismProperty<ShadowKindType> pKind;
try {
pKind = taskType.asPrismObject().findOrCreateProperty(
Expand Down
Expand Up @@ -674,7 +674,7 @@ private List<ObjectDelta<? extends ObjectType>> prepareChangesToExecute(TaskType
}

private TaskType createTask(TaskAddDto dto) throws SchemaException {
TaskType task = new TaskType();
TaskType task = new TaskType(getPrismContext());
MidPointPrincipal owner = SecurityUtils.getPrincipalUser();

ObjectReferenceType ownerRef = new ObjectReferenceType();
Expand Down

0 comments on commit 5073ea8

Please sign in to comment.