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

Spurious NullPointerException when restoring document from recycle bin #90

Closed
michitux opened this issue Jan 26, 2024 · 0 comments
Closed
Assignees
Milestone

Comments

@michitux
Copy link

When restoring a document from the recycle bin, I got a NullPointerException in TaskMacroUpdateEventListener. The document did not contain any task and was imported from Confluence. I haven't tried reproducing in these specific conditions but I definitely couldn't reproduce in a more standard situation. Still, I think the stack trace has enough information where the null value occurred to allow adding some bulletproofing:

Failed to send event [org.xwiki.bridge.event.DocumentCreatingEvent@ea4b3933] to listener [com.xwiki.task.internal.TaskMacroUpdateEventListener@5282a915]
class java.lang.NullPointerException: null
    at com.xwiki.task.internal.TaskMacroUpdateEventListener.updateTaskPages(TaskMacroUpdateEventListener.java:133)
    at com.xwiki.task.internal.TaskMacroUpdateEventListener.processEvent(TaskMacroUpdateEventListener.java:118)
    at com.xwiki.task.internal.AbstractTaskEventListener.onEvent(AbstractTaskEventListener.java:100)
    at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:320)
    at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:285)
    at com.xpn.xwiki.XWiki.beforeSave(XWiki.java:2015)
    at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2074)
    at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2001)
    at com.xpn.xwiki.XWiki.restoreFromRecycleBin(XWiki.java:7543)
    at org.xwiki.refactoring.internal.DefaultModelBridge.restoreDeletedDocument(DefaultModelBridge.java:522)
    at org.xwiki.refactoring.internal.job.RestoreJob.handleDeletedDocuments(RestoreJob.java:56)
    at org.xwiki.refactoring.internal.job.AbstractDeletedDocumentsJob.runInternal(AbstractDeletedDocumentsJob.java:89)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants