Skip to content

Commit e178470

Browse files
committed
fixes bug in ios_unpack.py
1 parent d4e8a57 commit e178470

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

forensic/ios_unpack.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@
3939
# Test if file exists
4040
infile = os.path.join(args.INPUT_FOLDER, row[0][0:2], row[0])
4141
if os.path.isfile(infile):
42-
if "/" in row[2]:
43-
# Make directories
44-
dirpath = os.path.join(args.OUTPUT_FOLDER, os.path.dirname(row[2]))
45-
if not os.path.isdir(dirpath):
46-
os.makedirs(dirpath)
47-
copyfile(infile, os.path.join(args.OUTPUT_FOLDER, row[2]))
48-
copied += 1
49-
if args.verbose:
50-
print("Copied {} to {}".format(row[0], row[2]))
42+
if row[2]:
43+
if "/" in row[2]:
44+
# Make directories
45+
dirpath = os.path.join(args.OUTPUT_FOLDER, os.path.dirname(row[2]))
46+
if not os.path.isdir(dirpath):
47+
os.makedirs(dirpath)
48+
copyfile(infile, os.path.join(args.OUTPUT_FOLDER, row[2]))
49+
copied += 1
50+
if args.verbose:
51+
print("Copied {} to {}".format(row[0], row[2]))
5152
else:
5253
if args.verbose:
5354
print("File {} not found".format(row[0]))

0 commit comments

Comments
 (0)