WebStormRequireJsPlugin icon indicating copy to clipboard operation
WebStormRequireJsPlugin copied to clipboard

"replacement" NullPointerException

Open psmacmur opened this issue 9 years ago • 0 comments

I recently started using the Require.js plugin in a large JS project to navigate to dependencies using Ctrl+b. This works quite well, but Webstorm notified me of the crash below.

I had just discovered a module reference that the plugin couldn't resolve (it underlined it with a squiggly red line). The root of the path wasn't defined in the file listed under "Require.js config file path". I didn't notice the error until after I added the path to the require.config section in the listed config file, so don't know whether it crashed when I tried (but failed) to navigate to the undefined path, or after editing the config.

replacement
java.lang.NullPointerException: replacement
    at java.util.regex.Matcher.replaceFirst(Matcher.java:950)
    at java.lang.String.replaceFirst(String.java:2119)
    at requirejs.RequirePaths.resolve(RequirePaths.java:42)
    at requirejs.Path.probeResolveRequirePath(Path.java:178)
    at requirejs.Path.resolve(Path.java:107)
    at requirejs.RequirejsProjectComponent.requireResolve(RequirejsProjectComponent.java:657)
    at requirejs.RequirejsReference.resolve(RequirejsReference.java:40)
    at com.intellij.lang.javascript.validation.JSAnnotatingVisitor.checkReferences(JSAnnotatingVisitor.java:252)
    at com.intellij.lang.javascript.validation.JSAnnotatingVisitor.visitJSLiteralExpression(JSAnnotatingVisitor.java:166)
    at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.accept(JSLiteralExpressionImpl.java:92)
    at com.intellij.lang.javascript.validation.JSAnnotatingVisitor.annotate(JSAnnotatingVisitor.java:119)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:159)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:340)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$100(GeneralHighlightingPass.java:64)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$3.run(GeneralHighlightingPass.java:269)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:294)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$200(GeneralHighlightingPass.java:64)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$4.run(GeneralHighlightingPass.java:300)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:297)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:266)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:205)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:97)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
    at com.intellij.codeInsight.problems.WolfTheProblemSolverImpl.a(WolfTheProblemSolverImpl.java:286)
    at com.intellij.codeInsight.problems.WolfTheProblemSolverImpl.startCheckingIfVincentSolvedProblemsYet(WolfTheProblemSolverImpl.java:239)
    at com.intellij.codeInsight.daemon.impl.WolfHighlightingPass.collectInformationWithProgress(WolfHighlightingPass.java:44)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:97)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:444)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1098)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:435)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:452)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:432)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:408)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask.exec(JobLauncherImpl.java:189)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

psmacmur avatar Aug 18 '15 18:08 psmacmur