Recover from panic when reading invalid id2 tags

Workaround for #596
This commit is contained in:
Deluan 2020-10-30 09:53:38 -04:00
parent cdd44a2830
commit 4d6c9482ff
1 changed files with 5 additions and 0 deletions

View File

@ -59,6 +59,11 @@ func (e *taglibExtractor) extractMetadata(filePath string) (*taglibMetadata, err
}
func hasEmbeddedImage(path string) bool {
defer func() {
if r := recover(); r != nil {
log.Error("Panic while checking for images. Please report this error with a copy of the file", "path", path, r)
}
}()
f, err := os.Open(path)
if err != nil {
log.Warn("Error opening file", "filePath", path, err)