Skip to content

Commit 80dfced

Browse files
committed
asdfghjkl;
1 parent caf451a commit 80dfced

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

processors/networks/image-network.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,19 @@ def process(self):
183183
if hash_type != "none" and image_hash in seen_hashes:
184184
# if we're deduplicating and the image is already in the graph,
185185
# merge the nodes (use the original node as the 'to node')
186-
to_node = hash_file_map[image_hash]
187-
if image_file != to_node:
186+
to_node = hash_file_map.get(image_hash)
187+
if to_node and image_file != to_node:
188188
self.dataset.update_status(f"Image {image_file} identified as a duplicate of {to_node} - "
189189
f"merging.")
190190

191191
else:
192192
seen_hashes.add(image_hash)
193193
to_node = image_file
194194

195+
if not to_node:
196+
# image could not be hashed, probably invalid file
197+
continue
198+
195199
if self.parameters.get("image-value") == "url":
196200
to_node = file_url_map[to_node]
197201

0 commit comments

Comments
 (0)