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

TexifyUtil nullpointer issue #423

Merged
merged 1 commit into from Mar 3, 2018
Merged

Conversation

Zukkari
Copy link
Contributor

@Zukkari Zukkari commented Feb 28, 2018

Additions

None.

Changes

Another fix for a nullpointer issue. Did not find an issue for this one, but encountered it myself. From previous issues we have learned that command.getName() is nullable, so could use optional here to avoid referencing null.

Here is the stacktrace:

null
java.lang.NullPointerException
	at nl.rubensten.texifyidea.util.TexifyUtil.isCommandKnown(TexifyUtil.java:656)
	at nl.rubensten.texifyidea.inspections.latex.LatexCommandAlreadyDefinedInspection.inspectFile(LatexCommandAlreadyDefinedInspection.kt:38)
	at nl.rubensten.texifyidea.inspections.TexifyInspectionBase.checkFile(TexifyInspectionBase.java:57)
	at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:142)
	at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
	at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:82)
	at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:70)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:286)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:254)
	at com.intellij.concurrency.ApplierCompleter.c(ApplierCompleter.java:133)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1127)
	at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:543)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
	at com.intellij.concurrency.ApplierCompleter.b(ApplierCompleter.java:116)
	at com.intellij.concurrency.ApplierCompleter.d(ApplierCompleter.java:96)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:143)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:229)
	at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)


java.lang.NullPointerException
	at nl.rubensten.texifyidea.util.TexifyUtil.isCommandKnown(TexifyUtil.java:656)
	at nl.rubensten.texifyidea.inspections.latex.LatexCommandAlreadyDefinedInspection.inspectFile(LatexCommandAlreadyDefinedInspection.kt:38)
	at nl.rubensten.texifyidea.inspections.TexifyInspectionBase.checkFile(TexifyInspectionBase.java:57)
	at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:142)
	at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
	at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:82)
	at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:70)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:286)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:254)
	at com.intellij.concurrency.ApplierCompleter.c(ApplierCompleter.java:133)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1127)
	at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:543)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
	at com.intellij.concurrency.ApplierCompleter.b(ApplierCompleter.java:116)
	at com.intellij.concurrency.ApplierCompleter.d(ApplierCompleter.java:96)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:143)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:229)
	at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)


Backwards incompatible changes

None.

@HannahSchellekens HannahSchellekens added the bug Deficiencies in TeXiFy behaviour. label Mar 1, 2018
@HannahSchellekens HannahSchellekens added this to the b0.6 milestone Mar 1, 2018
@HannahSchellekens HannahSchellekens merged commit 8ea70c7 into Hannah-Sten:master Mar 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants