add guard
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 17 May 2022 21:00:33 +0000 (23:00 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 17 May 2022 21:00:33 +0000 (23:00 +0200)
music_assistant/controllers/music/providers/filesystem.py

index 189b996f1258adc88d63235406f9d42a39395b32..4fafc395cc585b6fb0d4554f8428e5341d771965 100644 (file)
@@ -661,6 +661,8 @@ class FileSystemProvider(MusicProvider):
 
     def exists(self, file_path: str) -> bool:
         """Return bool is this FileSystem musicprovider has given file/dir."""
+        if not file_path:
+            return False  # guard
         # ensure we have a full path and not relative
         if self.config.path not in file_path:
             file_path = os.path.join(self.config.path, file_path)