Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(user-task): prevent npe for non-tenant configurations #68

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

coesterheld
Copy link
Collaborator

Closes #67

@CLAassistant
Copy link

CLAassistant commented Nov 27, 2024

CLA assistant check
All committers have signed the CLA.

@coesterheld coesterheld changed the title fix(user-task): prevent npe for non-tenant configurations (#67) fix(user-task): prevent npe for non-tenant configurations Nov 27, 2024
final var workerProperties = camunda8Properties.getUserTaskWorkerProperties(workflowModuleId);
workerProperties.applyToUserTaskWorker(userTaskWorker);
return userTaskWorker;
return tenantId != null ? userTaskWorker.tenantId(tenantId) : userTaskWorker;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this line into a separate if-statement: Using a tenaer operate is OK in general but not here in combination with the return statement. It tells that different responses are expected depending on the given condition. But actually, the worker needs to be configured properly depending on the given condition regardless whether it is return by the method or not. Additionally, I would place it underneath line 116 since the tenant is an crucial configuration as the other aspects above line 116 but the configuration in 117/118 are nice-to-haves:

        ...
        .name(workerId);

    if (tenantId != null) {
        userTaskWorker.tenantId(tenantId);
    }

    final var workerProperties = ....

@stephanpelikan stephanpelikan merged commit 2430dfd into main Dec 6, 2024
3 checks passed
@stephanpelikan stephanpelikan deleted the bugfix/issue-67-fix-npe-for-non-tenant-configs branch December 11, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error "NullPointerException" when opening a user task workers if multi-tenancy is disabled
3 participants