Skip to content

"task is null" inside "tasks" macro #130

Description

@ClemensRobbenhaar

Unfortunately not much information, but in one case the overview of all tasks via the tasks macro failed with the error message:

Failed to execute the [velocity] macro. Cause: [Cannot invoke "com.xwiki.task.model.Task.getReference()" because "task" is null]. Click on this message for details.

Clicking on the message however does not show any details. There is nothing in the logs or in the HTML code of the page (as far as I could see.)

Maybe this is caused by the code here not checking for null:

if (!authorizationManager.hasAccess(Right.VIEW, task.getReference())) {

while the DefaultTaskManager.getTask(int) might return null if the document does not contain a task (esp. if it does not exist)

This should not happen, as the query should not return any results, but I have no better explanation. Maybe some bullet proofing (or a different exception in the DefaultTaskManager) would help.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions