Skip to content

Commit

Permalink
WyC: Fix for #392.
Browse files Browse the repository at this point in the history
This fixes a problem when accidentally compiling a file kind is
effectively unknown.  Previously, a null pointer message was reported.
  • Loading branch information
DavePearce committed Sep 11, 2014
1 parent 2d4f281 commit 88bf3e7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/wyc/src/wyc/util/WycBuildTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,18 @@ public void setExcludes(String excludes) {
*
* @param _args
*/
public void build(List<File> files) throws Exception {
buildEntries(whileyDir.find(files, WhileyFile.ContentType));
public void build(List<File> files) throws Exception {
List<Path.Entry<WhileyFile>> entries = whileyDir.find(files,
WhileyFile.ContentType);
int j = 0;
for (int i = 0; j < files.size(); ++i, ++j) {
if (entries.get(i) == null) {
logout.println("WARNING: ignoring unknown file "
+ files.get(j).getName());
entries.remove(i--);
}
}
buildEntries(entries);
}

/**
Expand Down

0 comments on commit 88bf3e7

Please sign in to comment.