Don't fail when reading an empty file

This commit is contained in:
Mike Farah
2020-02-03 09:15:16 +11:00
parent b7554e6e76
commit f52de57652
2 changed files with 22 additions and 4 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ func readYamlFile(filename string, path string, updateAll bool, docIndexInt int)
func handleEOF(updateAll bool, docIndexInt int, currentIndex int) error {
log.Debugf("done %v / %v", currentIndex, docIndexInt)
if !updateAll && currentIndex <= docIndexInt {
if !updateAll && currentIndex <= docIndexInt && docIndexInt != 0 {
return fmt.Errorf("Could not process document index %v as there are only %v document(s)", docIndex, currentIndex)
}
return nil