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 potential NullPointerException in addAuthorizationsForNewProcessD… #4034

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yannaingtun
Copy link

Description:
This PR adds a null check for the process parameter in addAuthorizationsForNewProcessDefinition() to prevent potential NullPointerExceptions when this method is called with a null process.

Issue:
When the process parameter is null, calling process.getCandidateStarterUsers() or process.getCandidateStarterGroups() throws a NullPointerException, which can cause application crashes.

Fix:
Added a conditional check to verify the process parameter is not null before attempting to access its methods.

References:
Similar issue was fixed in: Activiti/Activiti@f4ad999
This implementation applies the same fix pattern to prevent null dereference

@filiphr
Copy link
Contributor

filiphr commented Mar 10, 2025

@yannaingtun can you please provide a test case for this?

I do not see how this piece of code can throw a NullPointerException. Especially, because in the 2 methods before this gets called we get the process from the parsed deployment and invoke something on it without doing a null check.

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.

2 participants