Check valid file on get_size (#13756)
Addresses https://github.com/home-assistant/home-assistant/issues/13754
This commit is contained in:
parent
40d7857f3b
commit
ef16c53e46
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue