Check valid file on get_size (#13756)

Addresses https://github.com/home-assistant/home-assistant/issues/13754
This commit is contained in:
Robin 2018-04-08 10:32:49 +01:00 committed by Daniel Høyer Iversen
parent 40d7857f3b
commit ef16c53e46
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ def get_files_list(folder_path, filter_term):
def get_size(files_list):
"""Return the sum of the size in bytes of files in the list."""
size_list = [os.stat(f).st_size for f in files_list]
size_list = [os.stat(f).st_size for f in files_list if os.path.isfile(f)]
return sum(size_list)