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

java.lang.NullPointerException at org.kohsuke.stapler.idea.JellyDocumentationProvider.generateDoc #78

Closed
timja opened this issue Dec 3, 2021 · 1 comment · Fixed by #80
Assignees
Labels

Comments

@timja
Copy link
Member

timja commented Dec 3, 2021

I opened select.jelly in Jenkins core

Unhandled exception in [StandaloneCoroutine{Cancelling}@b5e94c, EdtCoroutineDispatcher@3ca2a472]

java.lang.NullPointerException
	at org.kohsuke.stapler.idea.JellyDocumentationProvider.generateDoc(JellyDocumentationProvider.java:44)
	at com.intellij.lang.documentation.CompositeDocumentationProvider.generateDoc(CompositeDocumentationProvider.java:141)
	at com.intellij.lang.documentation.psi.PsiElementDocumentationTarget.localDoc(PsiElementDocumentationTarget.kt:70)
	at com.intellij.lang.documentation.psi.PsiElementDocumentationTarget.computeDocumentation(PsiElementDocumentationTarget.kt:56)
	at com.intellij.lang.documentation.impl.ImplKt$computeDocumentationAsync$1$documentationResult$1.invoke(impl.kt:25)
	at com.intellij.lang.documentation.impl.ImplKt$computeDocumentationAsync$1$documentationResult$1.invoke(impl.kt)
	at com.intellij.openapi.progress.CancellationKt$sam$com_intellij_openapi_util_ThrowableComputable$0.compute(cancellation.kt)
	at com.intellij.openapi.progress.Cancellation.withJob(Cancellation.java:65)
	at com.intellij.openapi.progress.CancellationKt.withJob(cancellation.kt:12)
	at com.intellij.openapi.application.rw.ReadAction$tryReadAction$3.run(ReadAction.kt:74)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1084)
	at com.intellij.openapi.application.rw.ReadAction.tryReadAction(ReadAction.kt:71)
	at com.intellij.openapi.application.rw.ReadAction.access$tryReadAction(ReadAction.kt:14)
	at com.intellij.openapi.application.rw.ReadAction$tryReadAction$2$2.run(ReadAction.kt:62)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
	at com.intellij.openapi.application.rw.ReadAction$tryReadAction$2.invokeSuspend(ReadAction.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
@duemir
Copy link
Member

duemir commented Dec 3, 2021

Yep, one of the parameters is annotated @Nullable but not treated as such :(

duemir added a commit to duemir/idea-stapler-plugin that referenced this issue Jan 11, 2022
* Refactor by using `AbstractDocumentationProvider` the abstract class suggested in the docs instead of the interface `DocumentationProvider`
* Exit when nullable parameter is `null`. At the moment, decision what doc to show is based purely on this argument so nothing to do when it is empty.
@duemir duemir linked a pull request Jan 11, 2022 that will close this issue
duemir added a commit that referenced this issue Jan 12, 2022
Avoid #78 by short-circuiting on null in nullable parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants