fixed crash on empty metadata
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
)
|
||||
|
||||
func readVorbisMetadata(file string) (*Metadata, error) {
|
||||
slog.Debug("Reading VORBIS metadata", "file", file)
|
||||
|
||||
f, err := os.Open(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -27,6 +29,11 @@ func readVorbisMetadata(file string) (*Metadata, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if cmt == nil {
|
||||
slog.Debug("Metadata empty", "file", file)
|
||||
return &Metadata{}, nil
|
||||
}
|
||||
|
||||
titles, err := cmt.Get(flacvorbis.FIELD_TITLE)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user