From e2f5d60b5134a44c52495fc5836acbcd6fc28926 Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Thu, 1 Nov 2018 19:54:54 -0400 Subject: [PATCH] Fix an indexing error which caused FileSystemSource.get() to return the oldest object instead of the newest. --- stix2/datastore/filesystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stix2/datastore/filesystem.py b/stix2/datastore/filesystem.py index 1d69e7d..a07754a 100644 --- a/stix2/datastore/filesystem.py +++ b/stix2/datastore/filesystem.py @@ -529,7 +529,7 @@ class FileSystemSource(DataSource): all_data = self.all_versions(stix_id, version=version, _composite_filters=_composite_filters) if all_data: - stix_obj = sorted(all_data, key=lambda k: k['modified'])[0] + stix_obj = sorted(all_data, key=lambda k: k['modified'])[-1] else: stix_obj = None