Skip to content

Commit

Permalink
#482 - 'directory' for Utils.isUnder must not be null in IgnoreManager
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Oct 11, 2017
1 parent e3f4f6c commit 3dfdbe4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mobi/hsz/idea/gitignore/IgnoreManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,11 @@ public IgnoreManager(@NotNull final Project project) {
*/
public boolean isFileIgnored(@NotNull final VirtualFile file) {
final Boolean cached = expiringStatusCache.get(file);
final VirtualFile baseDir = myProject.getBaseDir();
if (cached != null) {
return cached;
}
if (DumbService.isDumb(myProject) || !isEnabled() || !Utils.isUnder(file, myProject.getBaseDir())) {
if (DumbService.isDumb(myProject) || !isEnabled() || baseDir == null || !Utils.isUnder(file, baseDir)) {
return false;
}

Expand Down Expand Up @@ -377,7 +378,7 @@ public boolean isFileIgnored(@NotNull final VirtualFile file) {

if (valuesCount > 0 && !ignored && !matched) {
final VirtualFile directory = file.getParent();
if (directory != null && !directory.equals(myProject.getBaseDir())) {
if (directory != null && !directory.equals(baseDir)) {
for (VcsRoot vcsRoot : vcsRoots) {
if (directory.equals(vcsRoot.getPath())) {
return expiringStatusCache.set(file, false);
Expand Down

0 comments on commit 3dfdbe4

Please sign in to comment.