zielu / GitToolBox

GitToolBox IntelliJ plugin
GNU General Public License v3.0
604 stars 71 forks source link

[BUG]NPE in WebStorm 2022.2.2 #417

Closed shilohooo closed 1 year ago

shilohooo commented 1 year ago

Describe the bug NPE in WebStorm 2022.2.2

To Reproduce 1.Just open WebStorm

Expected behavior No error.

Plugin version 212.9.9

IDE version WebStorm 2022.2.2 Build #WS-222.4167.31, built on September 14, 2022 Subscription is active until December 30, 2022. Runtime version: 17.0.4+7-b469.53 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Registry: ide.experimental.ui.navbar.scroll=true ide.experimental.ui.title.toolbar.in.macos=false

Non-Bundled Plugins: one.util.ideaplugin.screenshoter (1.7.1) de.netnexus.camelcaseplugin (3.0.12) zielu.gittoolbox (212.9.9) cn.yiiguxing.plugin.translate (3.3.5)

Screenshots image

shilohooo commented 1 year ago

Stacktrace log:

java.util.concurrent.ExecutionException: java.lang.NullPointerException
    at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
    at git4idea.fetch.GitFetchSupportImpl.waitForFetchTasks(GitFetchSupportImpl.kt:191)
    at git4idea.fetch.GitFetchSupportImpl.access$waitForFetchTasks(GitFetchSupportImpl.kt:47)
    at git4idea.fetch.GitFetchSupportImpl$fetch$1.invoke(GitFetchSupportImpl.kt:107)
    at git4idea.fetch.GitFetchSupportImpl$fetch$1.invoke(GitFetchSupportImpl.kt:47)
    at git4idea.fetch.GitFetchSupportImpl.withIndicator(GitFetchSupportImpl.kt:213)
    at git4idea.fetch.GitFetchSupportImpl.fetch(GitFetchSupportImpl.kt:103)
    at git4idea.fetch.GitFetchSupportImpl.fetchAllRemotes(GitFetchSupportImpl.kt:89)
    at zielu.gittoolbox.k.Q.a(SourceFile:25)
    at zielu.gittoolbox.k.O.b(SourceFile:171)
    at com.codahale.metrics.Timer.timeSupplier(Timer.java:136)
    at zielu.a.i.a.e.a(SourceFile:14)
    at zielu.gittoolbox.k.O.a(SourceFile:171)
    at zielu.gittoolbox.k.O.b(SourceFile:157)
    at zielu.gittoolbox.k.O.a(SourceFile:138)
    at zielu.gittoolbox.k.O.b(SourceFile:244)
    at zielu.gittoolbox.k.O.run(SourceFile:229)
    at zielu.a.b.f.a(SourceFile:11)
    at zielu.a.b.o.a(SourceFile:21)
    at zielu.a.b.o.invoke(SourceFile:18)
    at zielu.a.m.d.a(SourceFile:23)
    at zielu.a.b.l.run(SourceFile:18)
    at zielu.a.b.b.run(SourceFile:64)
    at zielu.a.b.f.a(SourceFile:11)
    at zielu.a.b.o.a(SourceFile:21)
    at zielu.a.b.o.invoke(SourceFile:18)
    at zielu.a.m.d.a(SourceFile:23)
    at zielu.a.b.l.run(SourceFile:18)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException
    at java.base/java.util.Objects.requireNonNull(Objects.java:208)
    at git4idea.GitVcs.getInstance(GitVcs.java:82)
    at git4idea.commands.GitHandler.<init>(GitHandler.java:141)
    at git4idea.commands.GitHandler.<init>(GitHandler.java:89)
    at git4idea.commands.GitHandler.<init>(GitHandler.java:107)
    at git4idea.commands.GitTextHandler.<init>(GitTextHandler.java:45)
    at git4idea.commands.GitLineHandler.<init>(GitLineHandler.java:56)
    at git4idea.commands.GitImpl.lambda$fetch$3(GitImpl.java:613)
    at git4idea.commands.GitImplBase.run(GitImplBase.java:116)
    at git4idea.commands.GitImplBase.runCommand(GitImplBase.java:69)
    at git4idea.commands.GitImpl.fetch(GitImpl.java:612)
    at git4idea.fetch.GitFetchSupportImpl.doFetch(GitFetchSupportImpl.kt:225)
    at git4idea.fetch.GitFetchSupportImpl.access$doFetch(GitFetchSupportImpl.kt:47)
    at git4idea.fetch.GitFetchSupportImpl$fetchInParallel$future$1$1$1.invoke(GitFetchSupportImpl.kt:156)
    at git4idea.fetch.GitFetchSupportImpl$fetchInParallel$future$1$1$1.invoke(GitFetchSupportImpl.kt:47)
    at git4idea.fetch.GitRemoteOperationQueueImpl.executeForRemote(GitRemoteOperationQueueImpl.kt:26)
    at git4idea.fetch.GitFetchSupportImpl$fetchInParallel$future$1$1.run(GitFetchSupportImpl.kt:155)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at git4idea.fetch.GitFetchSupportImpl$fetchInParallel$future$1.call(GitFetchSupportImpl.kt:153)
    at git4idea.fetch.GitFetchSupportImpl$fetchInParallel$future$1.call(GitFetchSupportImpl.kt:47)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:241)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:214)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:203)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    ... 1 more
zielu commented 1 year ago

@shilohooo as in open without opening any project or some project is opened too ?

shilohooo commented 1 year ago

no error in this window: image

shilohooo commented 1 year ago

In the morning, I first opened a project, and then the IDE reported an error later.

zielu commented 1 year ago

@shilohooo did you close some project along the way (opening in existing window counts too) ? This is error usually happens when project is closed and zombie auto-fetch task runs. It breaks nothing but I'll see if can I improve it.

zielu commented 1 year ago

Please switch to EAP channel and try 212.9.12. It has additional guards against zombie tasks throwing exceptions

shilohooo commented 1 year ago

Thank you:) I will try it.

zielu commented 1 year ago

I assume it's fine - closing, but threading will require another rework it seems :/

shilohooo commented 1 year ago

Ok, thanks:)