question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on opening .gitignore file

See original GitHub issue

Prerequisites

  • Plugin is in the latest version
  • Issue was not reported yet
  • Stack trace (if provided) contains mobi.hsz.idea.gitignore package name

Description

After updating the plugin to 2.0.0 today, I opened the .gitignore file in my project and the plugin threw an error.

null
java.lang.NullPointerException
	at mobi.hsz.idea.gitignore.util.MatcherUtil.match(MatcherUtil.java:84)
	at mobi.hsz.idea.gitignore.util.Glob$1.visitFile(Glob.java:126)
	at com.intellij.openapi.vfs.VirtualFileVisitor.visitFileEx(VirtualFileVisitor.java:132)
	at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:272)
	at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:304)
	at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:304)
	at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:304)
	at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:304)
	at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:304)
	at mobi.hsz.idea.gitignore.util.Glob.find(Glob.java:140)
	at mobi.hsz.idea.gitignore.util.Glob.findOne(Glob.java:69)
	at mobi.hsz.idea.gitignore.daemon.IgnoreDirectoryMarkerProvider.getLineMarkerInfo(IgnoreDirectoryMarkerProvider.java:71)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.a(LineMarkersPass.java:189)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.a(LineMarkersPass.java:111)
	at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:96)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:106)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:438)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1160)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:431)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:430)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:406)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:249)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
	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)

Steps to Reproduce

  1. Have existing project with .gitignore file
  2. Open the file

Expected behavior: No error

Actual behavior: Error is thrown

Reproduces how often: Only happened once so far.

Versions

Plugin:

2.2.0

IDE:

IntelliJ IDEA 2017.2.3

OS:

Ubuntu 17.04

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
hszcommented, Sep 5, 2017

@Ionaru Thanks for reporting. To be honest - it’s insane that this still happens. I covered this method with as many null checks as possible, but somehow it still has a problem with NPE.

Sorry for that - if it will happen again - let me know and I’ll speed up the next release.

0reactions
charlwillia6commented, Sep 6, 2017

This resolved the error for me, but the file coloring is still not working. And I get warning on every line that states " ‘…’ is never used more…".

This is in a .gitignore file.

Plugin:

2.2.1-RC1

IDE:

Rider 2017.2 EAP

OS:

Windows 10
Read more comments on GitHub >

github_iconTop Results From Across the Web

git - Gitignore not working - Stack Overflow
gitignore file must not have .txt extension. Here is how I resolved it. Open any directory and go to menu bar, click view,...
Read more >
How to fix "gitignore not working" issue - GitHub Gist
Commit all the changes to git. Exclude the folder/files you don't want commit, in my case node_modules · Execute the following command to...
Read more >
How to Fix Gitignore Not Working? – Here Are Solutions for You
Fix 1. Check the .gitignore File Format · Fix 2. Check the File That You Are Trying to Ignore · Fix 3. Add...
Read more >
Unable to open .gitignore files from solution explorer
I receive an error dialogue that reads “gitignore file name or extension cannot be associated with multiple content types.”
Read more >
Fixing error with .gitignore file not ignoring files - mohitgoyal.co
The first line unstages and removes the paths to your files from the git index recursively. The second line adds all your files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found