diff options
| author | jvoisin | 2020-07-22 15:47:35 +0200 |
|---|---|---|
| committer | jvoisin | 2020-07-22 15:47:35 +0200 |
| commit | 46b3ae16729c3f18c4bfebccf928e422a2e5c4f4 (patch) | |
| tree | 839162da8cd63bfc2f9be049666b5125b76b46ff | |
| parent | d0bc79442b001efabcea4749b2aba0d72772fe3d (diff) | |
Fix a crash affecting some mp3 files
| -rw-r--r-- | libmat2/audio.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmat2/audio.py b/libmat2/audio.py index 5f0c765..0d54930 100644 --- a/libmat2/audio.py +++ b/libmat2/audio.py | |||
| @@ -37,6 +37,8 @@ class MP3Parser(MutagenParser): | |||
| 37 | def get_meta(self) -> Dict[str, Union[str, dict]]: | 37 | def get_meta(self) -> Dict[str, Union[str, dict]]: |
| 38 | metadata = {} # type: Dict[str, Union[str, dict]] | 38 | metadata = {} # type: Dict[str, Union[str, dict]] |
| 39 | meta = mutagen.File(self.filename).tags | 39 | meta = mutagen.File(self.filename).tags |
| 40 | if not meta: | ||
| 41 | return metadata | ||
| 40 | for key in meta: | 42 | for key in meta: |
| 41 | if not hasattr(meta[key], 'text'): # pragma: no cover | 43 | if not hasattr(meta[key], 'text'): # pragma: no cover |
| 42 | continue | 44 | continue |
