Skip to content

Commit

Permalink
Fixed #533 IndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Apr 13, 2018
1 parent 4dfb402 commit 43bb77a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mobi/hsz/idea/gitignore/util/Glob.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ private Glob() {
@Nullable
public static VirtualFile findOne(@NotNull final VirtualFile root, @NotNull IgnoreEntry entry,
@NotNull MatcherUtil matcher) {
return find(root, ContainerUtil.newArrayList(entry), matcher, false).get(entry).get(0);
List<VirtualFile> files = find(root, ContainerUtil.newArrayList(entry), matcher, false).get(entry);
if (files == null || files.isEmpty()) {
return null;
}
return files.get(0);
}

/**
Expand Down

0 comments on commit 43bb77a

Please sign in to comment.