Skip to content

Commit

Permalink
Check if item is a file when using directory queue
Browse files Browse the repository at this point in the history
This fixes issues with the item count being wrong and whole directories
being passed on to the sender.
  • Loading branch information
DanielPerkins7 authored and tofu-rocketry committed Sep 26, 2023
1 parent fea27d7 commit afe46aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ssm/message_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def _get_messages(self, sort_by_mtime=False):
for (file_name, _mtime) in sorted(unsorted_messages,
key=lambda tup: tup[1]):
# Store the sorted file paths in a class element.
sorted_messages.append(file_name)
if os.path.isfile(file_name):
sorted_messages.append(file_name)
else:
continue

# Return the sorted list.
return sorted_messages
Expand Down

0 comments on commit afe46aa

Please sign in to comment.