Skip to content
Snippets Groups Projects
Commit b942ed7a authored by Marcos Peña's avatar Marcos Peña Committed by JuniorJPDJ
Browse files

Adds sanity check to prevent uncontrolled exception from untagged imported tracks (!1382)

parent ae56890f
No related branches found
No related tags found
No related merge requests found
......@@ -357,6 +357,8 @@ class Metadata(Mapping):
self._file = kind(filething)
if self._file is None:
raise ValueError("Cannot parse metadata from {}".format(filething))
if len(self._file) == 0:
raise ValueError("No tags found in {}".format(filething))
self.fallback = self.load_fallback(filething, self._file)
ft = self.get_file_type(self._file)
try:
......
Prevents an uncontrolled exception when uploading a file without tags, and prints user friendly message (1275)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment