Skip to content

Fix NPE in useCMap() - #714

Merged
MaximPlusov merged 2 commits into
integrationfrom
cmap-npe
Aug 11, 2026
Merged

Fix NPE in useCMap()#714
MaximPlusov merged 2 commits into
integrationfrom
cmap-npe

Conversation

@LonelyMidoriya

@LonelyMidoriya LonelyMidoriya commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of missing character map data by safely ignoring invalid inputs.
    • Added warning notifications when incomplete mapping information is encountered.

@LonelyMidoriya LonelyMidoriya self-assigned this Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 432c82fd-d85a-4c25-a565-75556ff424b7

📥 Commits

Reviewing files that changed from the base of the PR and between 8a751e9 and 9a7b582.

📒 Files selected for processing (1)
  • src/main/java/org/verapdf/pd/font/cmap/CMap.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/org/verapdf/pd/font/cmap/CMap.java

📝 Walkthrough

Walkthrough

useCMap now validates its input. Null arguments produce a warning and no state change. Non-null arguments continue to merge mappings and codespaces.

Changes

CMap validation

Layer / File(s) Summary
Guard null CMap inputs
src/main/java/org/verapdf/pd/font/cmap/CMap.java
useCMap logs a warning and returns when the argument is null. Valid arguments retain the existing merge behavior.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing a null-pointer exception in useCMap().
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 cmap-npe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@MaximPlusov
MaximPlusov merged commit 4f149c1 into integration Aug 11, 2026
9 checks passed
@MaximPlusov
MaximPlusov deleted the cmap-npe branch August 11, 2026 11:38
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