Merge pull request #12 from pichljan/master

Repaired error caused by deletion of file with insufficient permissions.
This commit is contained in:
didfet
2015-06-23 14:23:35 +02:00
2 changed files with 4 additions and 1 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@
/bin/
/testFileReader1.txt
/state2.json
.idea/
logstash-forwarder-java.iml

View File

@@ -298,7 +298,8 @@ public class FileWatcher {
public void onFileDelete(File file) {
try {
logger.debug("Delete detected on file : " + file.getCanonicalPath());
oldWatchMap.get(file).setDeleted();
FileState state = oldWatchMap.get(file);
if (state != null) state.setDeleted();
} catch (IOException e) {
logger.error("Caught IOException : " + e.getMessage());
}