Skip to content

NPE with plugin version 0.0.47 and PhpStorm 2025.1.1 #242

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

Open
mromeike opened this issue May 16, 2025 · 1 comment
Open

NPE with plugin version 0.0.47 and PhpStorm 2025.1.1 #242

mromeike opened this issue May 16, 2025 · 1 comment

Comments

@mromeike
Copy link

When opening a project that uses Shopware, the following error occurs:

Image
java.lang.NullPointerException
	at de.shyim.shopware6.intentions.AddTwigVersioningIntention.isAvailable(AddTwigVersioningIntention.kt:32)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.availableFor(ShowIntentionActionsHandler.java:199)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.lambda$getRegisteredIntentionActions$6(ShowIntentionsPass.java:379)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseBetweenHostAndInjected(ShowIntentionActionsHandler.java:269)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.getRegisteredIntentionActions(ShowIntentionsPass.java:378)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.getActionsToShow(ShowIntentionsPass.java:350)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doCollectInformation(ShowIntentionsPass.java:250)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:435)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:28)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:431)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction$lambda$11(AnyThreadWriteThreadingSupport.kt:522)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:522)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1064)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$4(PassExecutorService.java:421)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:680)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:755)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:711)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:77)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:420)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:395)
	at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.cacheFileTypesInside(FileTypeManagerImpl.java:834)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$1(PassExecutorService.java:395)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:197)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:393)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:267)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

PhpStorm version: Build #PS-251.25410.148, built on May 13, 2025
Shopware version:

$ composer show shopware/core

name     : shopware/core
descrip. : Shopware platform is the core for all Shopware ecommerce products.
keywords : shop, shopware
versions : * v6.6.10.4
released : 2025-04-29, 2 weeks ago
@amenk
Copy link
Contributor

amenk commented May 31, 2025

@mromeike

That is the causing line:

.getValues(TwigBlockHashIndex.key, blockTag.name!!, GlobalSearchScope.allScope(project))

I can reproduce it with a block without a name:

{% block  %}

But I actively have to call the intention or open such file containing such empty block. Otherwise - when I have such a nameless block in the project, I am actually getting

com.intellij.diagnostic.PluginException: Failed to build index 'de.shyim.shopware6.frontend.twig_blocks' for file ..../Resources/views/storefront/component/checkout/offcanvas-cart-summary.html.twig (id = 7106) (file type = Twig) [Plugin: de.shyim.shopware6]

when opening the project.

Can you search your project for blocks without a name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants