Skip to content

Commit

Permalink
Fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Lazzarotto authored and Andrea Lazzarotto committed Nov 20, 2016
1 parent de2ee47 commit 5744125
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions recuperabit/fs/ntfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,19 @@ def _integrate_attribute_list(parsed, part, image):
# Divide entries by type
types = set(e['type'] for e in entries)
entries_by_type = {
t: set(e['file_ref'] for e in entries if e['type'] == t)
t: set(
e['file_ref'] for e in entries
if e['type'] == t and e['file_ref'] is not None
)
for t in types
}
# Remove completely "local" types
# Remove completely "local" types or empty lists
for num in list(entries_by_type):
files = entries_by_type[num]
if len(files) == 1 and iter(files).next() == base_record:
if (
len(files) == 0 or
(len(files) == 1 and iter(files).next() == base_record)
):
del entries_by_type[num]

mft_pos = part.mft_pos
Expand Down

0 comments on commit 5744125

Please sign in to comment.