diff --git a/src/main/java/net/szum123321/textile_backup/core/digest/HashingInputStream.java b/src/main/java/net/szum123321/textile_backup/core/digest/HashingInputStream.java index 2f51eb0..6a31343 100644 --- a/src/main/java/net/szum123321/textile_backup/core/digest/HashingInputStream.java +++ b/src/main/java/net/szum123321/textile_backup/core/digest/HashingInputStream.java @@ -71,11 +71,11 @@ public class HashingInputStream extends FilterInputStream { @Override public void close() throws IOException { + latch.countDown(); + if(in.available() == 0) hashBuilder.update(path, hasher.getValue()); else brokenFileHandler.handle(path, new DataLeftException(in.available())); - latch.countDown(); - super.close(); } }