diff --git a/video_metadata/views/file_listing.py b/video_metadata/views/file_listing.py index df7b40f..d12f392 100644 --- a/video_metadata/views/file_listing.py +++ b/video_metadata/views/file_listing.py @@ -74,7 +74,9 @@ def getFolderJSON(subpath = ''): # validate input if re.search('\.\.', subpath) or not os.path.exists(full_path): - errors.append('invalid path?: {}'.format(full_path)) + errors.append('invalid path: {}'.format(full_path)) + elif not os.path.isdir(full_path): + errors.append('path is not a directory: {}'.format(full_path)) else: for entry in os.scandir(full_path): # TODO: remove 'getPathInfo()' when finished with async file listing