File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -183,15 +183,19 @@ def process(self):
183
183
if hash_type != "none" and image_hash in seen_hashes :
184
184
# if we're deduplicating and the image is already in the graph,
185
185
# 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 :
188
188
self .dataset .update_status (f"Image { image_file } identified as a duplicate of { to_node } - "
189
189
f"merging." )
190
190
191
191
else :
192
192
seen_hashes .add (image_hash )
193
193
to_node = image_file
194
194
195
+ if not to_node :
196
+ # image could not be hashed, probably invalid file
197
+ continue
198
+
195
199
if self .parameters .get ("image-value" ) == "url" :
196
200
to_node = file_url_map [to_node ]
197
201
You can’t perform that action at this time.
0 commit comments