fix(importer): guard _stamp_member_archive against a sidecar-less archive
A filesystem-imported archive with no adjacent sidecar has no Post, so _post_for_sidecar returns None — and the milestone-#87 stamp call dereferenced post.id. _stamp_member_archive already no-ops on a None post_id (no post → no provenance to stamp); pass None instead of crashing. Caught by the existing test_reimport_archive_is_idempotent (no-sidecar zip). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -534,7 +534,9 @@ class Importer:
|
|||||||
# branches stay untouched. NULL-only so a re-extract never re-stamps and
|
# branches stay untouched. NULL-only so a re-extract never re-stamps and
|
||||||
# the backfill (reextract task → this same path) is idempotent. Nested
|
# the backfill (reextract task → this same path) is idempotent. Nested
|
||||||
# members link to this OUTER archive — the only one stored as a blob.
|
# members link to this OUTER archive — the only one stored as a blob.
|
||||||
self._stamp_member_archive(post.id, source, member_record_ids)
|
self._stamp_member_archive(
|
||||||
|
post.id if post is not None else None, source, member_record_ids,
|
||||||
|
)
|
||||||
if member_ids:
|
if member_ids:
|
||||||
return ImportResult(
|
return ImportResult(
|
||||||
status="imported", image_id=member_ids[0],
|
status="imported", image_id=member_ids[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user