Skip to content

Commit

Permalink
#391 - Error when changing directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Jul 29, 2017
1 parent 809b491 commit e32c616
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Fixed "You are editing..." message display conditions [\#351](https://github.com/hsz/idea-gitignore/issues/351) [\#352](https://github.com/hsz/idea-gitignore/issues/352) [\#356](https://github.com/hsz/idea-gitignore/issues/356)
- It's prohibited to access index during event dispatching [\#358](https://github.com/hsz/idea-gitignore/issues/358) [\#355](https://github.com/hsz/idea-gitignore/issues/355) [\#369](https://github.com/hsz/idea-gitignore/issues/369)
- Already disposed: com.intellij.util.messages.impl.MessageBusImpl [\#360](https://github.com/hsz/idea-gitignore/issues/360)
- NotNull error when changing directory name [\##391](https://github.com/hsz/idea-gitignore/issues/#391)

## [v1.7.6](https://github.com/hsz/idea-gitignore/tree/v1.7.6) (2017-02-23)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Changelog
- Fixed "You are editing..." message display conditions [\#351](https://github.com/hsz/idea-gitignore/issues/351) [\#352](https://github.com/hsz/idea-gitignore/issues/352) [\#356](https://github.com/hsz/idea-gitignore/issues/356)
- It's prohibited to access index during event dispatching [\#358](https://github.com/hsz/idea-gitignore/issues/358) [\#355](https://github.com/hsz/idea-gitignore/issues/355) [\#369](https://github.com/hsz/idea-gitignore/issues/369)
- Already disposed: com.intellij.util.messages.impl.MessageBusImpl [\#360](https://github.com/hsz/idea-gitignore/issues/360)
- NotNull error when changing directory name [\##391](https://github.com/hsz/idea-gitignore/issues/#391)

[Full Changelog History](./CHANGELOG.md)

Expand Down
1 change: 1 addition & 0 deletions resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<li>Fixed "You are editing..." message display conditions (<a href="https://github.com/hsz/idea-gitignore/issues/351">351</a>, <a href="https://github.com/hsz/idea-gitignore/issues/352">352</a>, <a href="https://github.com/hsz/idea-gitignore/issues/356">356</a>)</li>
<li>It's prohibited to access index during event dispatching (<a href="https://github.com/hsz/idea-gitignore/issues/358">358</a>, <a href="https://github.com/hsz/idea-gitignore/issues/355">355</a>, <a href="https://github.com/hsz/idea-gitignore/issues/369">369</a>)</li>
<li>Already disposed: com.intellij.util.messages.impl.MessageBusImpl (<a href="https://github.com/hsz/idea-gitignore/issues/360">360</a>)</li>
<li>NotNull error when changing directory name (<a href="https://github.com/hsz/idea-gitignore/issues/391">391</a>)</li>
</ul>
<a href="https://github.com/hsz/idea-gitignore/blob/master/CHANGELOG.md"><b>Full Changelog History</b></a>
Expand Down
1 change: 1 addition & 0 deletions resources/messages/IgnoreBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Fixes:<br/>\
- Fixed "You are editing..." message display conditions (#351, #352, #356)<br/>\
- It's prohibited to access index during event dispatching (#358, #355, #369)<br/>\
- Already disposed: com.intellij.util.messages.impl.MessageBusImpl (#360)<br/>\
- NotNull error when changing directory name (#391)<br/>\
<br/>\
<span style="font-size: 120%">If you find my plugin helpful, donate me using <br/><b>\
<a href="https://www.paypal.me/hsz">PayPal</a> or \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class IgnoreFileGroupAction extends ActionGroup {
private final String presentationTextSingleKey;

/** {@link Project}'s base directory. */
@Nullable
private VirtualFile baseDir;

/**
Expand Down Expand Up @@ -139,7 +140,7 @@ public AnAction[] getChildren(@Nullable AnActionEvent e) {
AnAction[] actions;
int count = countFiles();

if (count == 0) {
if (count == 0 || baseDir == null) {
actions = new AnAction[0];
} else {
actions = new AnAction[count];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ private boolean isEntryExcluded(@NotNull IgnoreEntry entry, @NotNull Project pro
final List<VirtualFile> matched = ContainerUtil.newArrayList();
final Collection<VirtualFile> files = cache.getFilesForPattern(project, pattern);

if (projectRoot == null) {
return false;
}

for (final VirtualFile root : Utils.getExcludedRoots(project)) {
for (VirtualFile file : files) {
if (!Utils.isUnder(file, root)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public boolean visitFile(@NotNull VirtualFile file) {
continue;
}

String name = (root != null) ? Utils.getRelativePath(root, file) : file.getName();
final String name = (root != null) ? Utils.getRelativePath(root, file) : file.getName();
if (MatcherUtil.match(matcher, name)) {
PsiFileSystemItem psiFileSystemItem = getPsiFileSystemItem(manager, file);
if (psiFileSystemItem == null) {
Expand Down

0 comments on commit e32c616

Please sign in to comment.