diff --git a/JHazm/src/JHazm/HamshahriReader.java b/JHazm/src/JHazm/HamshahriReader.java index 1bca8eb..1376988 100644 --- a/JHazm/src/JHazm/HamshahriReader.java +++ b/JHazm/src/JHazm/HamshahriReader.java @@ -100,6 +100,10 @@ protected void yieldNextCore() { if (!isOpen) { do { index++; + if (index >= allFiles.size()) { + yieldBreak(); + return; + } file = new File(allFiles.get(index)); } while (getInvalidFiles().contains(file.getName())); } @@ -178,4 +182,4 @@ protected void yieldNextCore() { } } } -} \ No newline at end of file +}