Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Unexpected null reference exception while trying to fetch the taskModel from executionDAOFacade #2926

Closed
amirpopovich opened this issue Apr 18, 2022 · 0 comments
Assignees
Labels
type: bug bugs/ bug fixes

Comments

@amirpopovich
Copy link

Describe the bug

In method TaskModel getTaskModel(String taskId) within class ExecutionDAOFacade, if the call to getTaskFromDatastore(taskId) returns null, an unhandled exception will be thrown on the next line, when a call to populateTaskData(TaskModel taskModel) is made.

Details
Conductor version: 3.6.1
Persistence implementation: Dynomite
Queue implementation: Dynoqueues
Lock: Redis

Expected behavior
Check if the taskModel is null before calling populateTaskData as implemented in the method public Task getTask(String taskId).
This was the behavior in the past, until commit 3c74e0c45d710dc89b67ecdb6f3bbeeea27753a6 was made which did some changes without adding the null validation check.

Current Implementation

public TaskModel getTaskModel(String taskId) {
    TaskModel taskModel = getTaskFromDatastore(taskId);
    populateTaskData(taskModel);
    return taskModel;
}

Expected Implementation

 public TaskModel getTaskModel(String taskId) {
    TaskModel taskModel = getTaskFromDatastore(taskId);
    if(taskModel != null){
        populateTaskData(taskModel);
    }
    return taskModel;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug bugs/ bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants