Skip to content

claude ingest: tolerate a null file_name in the export - #1

Merged
phonkd merged 1 commit into
mainfrom
fix-claude-null-filename
Jul 22, 2026
Merged

claude ingest: tolerate a null file_name in the export#1
phonkd merged 1 commit into
mainfrom
fix-claude-null-filename

Conversation

@phonkd

@phonkd phonkd commented Jul 22, 2026

Copy link
Copy Markdown
Owner

A Claude.ai export can carry a files/attachments entry whose file_name key is present but explicitly null (a file shared without a name). dict.get("file_name", "?") only substitutes the default for a missing key, so the null flowed into ", ".join(files) and crashed the whole ingest with TypeError: sequence item 0: expected str instance, NoneType found. Fall back with or "?" so the placeholder is still produced.

A Claude.ai export can carry a files/attachments entry whose file_name
key is present but explicitly null (a file shared without a name).
`dict.get("file_name", "?")` only substitutes the default for a *missing*
key, so the null flowed into `", ".join(files)` and crashed the whole
ingest with `TypeError: sequence item 0: expected str instance, NoneType
found`. Fall back with `or "?"` so the placeholder is still produced.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 21:30
@phonkd
phonkd merged commit b68b58f into main Jul 22, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves robustness of the Claude.ai export ingester by preventing a crash when a shared file/attachment has an explicitly null file_name in the export payload.

Changes:

  • Handle file_name: null by falling back to "?" so ", ".join(files) always receives strings.
  • Add inline rationale explaining why .get("file_name", "?") was insufficient for explicit nulls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants