Skip to content

Fix TypeError on null data in unknown external plugins - #13

Merged
nhanphan merged 1 commit into
mainfrom
claude/fix-base64-null-handling-omr0U
Mar 24, 2026
Merged

Fix TypeError on null data in unknown external plugins#13
nhanphan merged 1 commit into
mainfrom
claude/fix-base64-null-handling-omr0U

Conversation

@nhanphan

Copy link
Copy Markdown
Contributor

Summary

  • Adds null checks before base64.serialize(unknownPlugin.data) in both handleUnknownPlugins and handleUnknownExternalPlugins to prevent TypeError: Cannot read properties of null (reading 'replace')
  • DAS providers return data: null for AgentIdentity external plugins (type 6, added in mpl-core 1.8.0) that haven't been fully indexed yet — plugins with null data are now safely skipped

Test plan

  • Verify that assets with AgentIdentity external plugins (type 6, data: null) no longer throw
  • Verify that assets with populated unknown plugin data still deserialize correctly
  • Run existing test suite to confirm no regressions

https://claude.ai/code/session_01TeLg2WS1YxYzQDkaskvQ8r

DAS providers return unknown_external_plugins with data: null for
AgentIdentity plugins (type 6) that haven't been fully indexed yet.
base64.serialize(null) throws "Cannot read properties of null
(reading 'replace')". Add null checks to skip plugins with null data
in both handleUnknownPlugins and handleUnknownExternalPlugins.

https://claude.ai/code/session_01TeLg2WS1YxYzQDkaskvQ8r
@vercel

vercel Bot commented Mar 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mpl-core-das Error Error Mar 24, 2026 11:48pm

Request Review

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b0d33784-02fe-4d5a-8fdd-a3a588aae58b

📥 Commits

Reviewing files that changed from the base of the PR and between 632915c and 7ac295a.

📒 Files selected for processing (1)
  • src/helpers.ts

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced handling of plugins with missing or undefined data to prevent processing errors.

Walkthrough

The PR adds null/undefined checks to the handleUnknownPlugins and handleUnknownExternalPlugins functions in helpers to skip processing when plugin data is missing, preventing attempted serialization of empty values.

Changes

Cohort / File(s) Summary
Plugin Data Validation
src/helpers.ts
Added null/undefined checks for unknownPlugin.data in handleUnknownPlugins and handleUnknownExternalPlugins to prevent serialization of missing or empty data fields.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: adding null checks to prevent TypeError when unknown external plugins have null data.
Description check ✅ Passed The description is directly related to the changeset, explaining the null check additions, the error being fixed, and the context around AgentIdentity plugins returning null data.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-base64-null-handling-omr0U

Comment @coderabbitai help to get the list of available commands and usage tips.

@nhanphan
nhanphan merged commit fac129c into main Mar 24, 2026
4 of 5 checks passed
@nhanphan
nhanphan deleted the claude/fix-base64-null-handling-omr0U branch March 24, 2026 23:53
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