fix image exist nil (#274)

#272
This commit is contained in:
Benny 2023-09-15 06:01:26 +02:00 committed by GitHub
parent d9da7f3cd3
commit 523294e6d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ func FileCount(dir string) int64 {
func ImageExists(filename string) bool {
info, err := os.Stat(filename)
if os.IsNotExist(err) {
if os.IsNotExist(err) || err != nil {
return false
}
// if file size is less than 100 bytes, we assume it's invalid file