Skip to content

fix: guard nil lower chunk in RFC2045.haircut (#433)#434

Merged
azumakuniyuki merged 2 commits into
sisimai:5-stablefrom
SAY-5:fix-haircut-nil-lowerchunk
Jun 7, 2026
Merged

fix: guard nil lower chunk in RFC2045.haircut (#433)#434
azumakuniyuki merged 2 commits into
sisimai:5-stablefrom
SAY-5:fix-haircut-nil-lowerchunk

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

A multipart part that carries a Content-Type header but no blank-line body makes block.split("\n\n", 2) return a single element, so lowerchunk becomes nil and haircut raises NoMethodError on lowerchunk.empty? at rfc2045.rb:203. This defaults lowerchunk to an empty string in that case, matching the existing nil guard for upperchunk just above. Added a haircut case for a header-only part to test/public/rfc2045-test.rb. Fixes #433.

SAY-5 and others added 2 commits June 5, 2026 19:04
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Removed checkout step ref specification for CRuby and JRuby because the workflow in sisimai#435 fails.
@azumakuniyuki azumakuniyuki merged commit 1369c6e into sisimai:5-stable Jun 7, 2026
4 of 5 checks passed
@azumakuniyuki

Copy link
Copy Markdown
Member

@SAY-5 Thanks for the patch, I've just merged it.

azumakuniyuki added a commit that referenced this pull request Jun 8, 2026
azumakuniyuki added a commit that referenced this pull request Jun 8, 2026
azumakuniyuki added a commit that referenced this pull request Jun 14, 2026
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.

Fix NoMethodError

2 participants