Repaired error caused by deletion of file with insufficient permissions.

This commit is contained in:
Jan Pichl
2015-06-22 19:03:31 +02:00
parent e055ac61bb
commit 5e7f32b732
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());
}