Skip to content

fix(h2): TypeError: Cannot read properties of null (reading 'servername') in _resume when H2 stream completes#4847

Merged
metcoder95 merged 1 commit intonodejs:mainfrom
hxinhan:main
Mar 3, 2026
Merged

fix(h2): TypeError: Cannot read properties of null (reading 'servername') in _resume when H2 stream completes#4847
metcoder95 merged 1 commit intonodejs:mainfrom
hxinhan:main

Conversation

@hxinhan
Copy link
Contributor

@hxinhan hxinhan commented Mar 1, 2026

This relates to...

#4846

The fix adds null check for request to avoid the following crash

TypeError: Cannot read properties of null (reading 'servername')
    at _resume (/opt/sye/node_modules/undici/lib/dispatcher/client.js:610:79)
    at resume (/opt/sye/node_modules/undici/lib/dispatcher/client.js:561:3)
    at Client.<computed> (/opt/sye/node_modules/undici/lib/dispatcher/client.js:285:31)
    at ClientHttp2Stream.<anonymous> (/opt/sye/node_modules/undici/lib/dispatcher/client-h2.js:720:22)
    at Object.onceWrapper (node:events:638:28)
    at ClientHttp2Stream.emit (node:events:536:35)
    at endReadableNT (node:internal/streams/readable:1698:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

mcollina commented Mar 2, 2026

Linting is failing, can you fix it?

@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.13%. Comparing base (85cde5d) to head (e92595f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4847      +/-   ##
==========================================
- Coverage   93.14%   93.13%   -0.01%     
==========================================
  Files         109      109              
  Lines       34239    34243       +4     
==========================================
+ Hits        31891    31893       +2     
- Misses       2348     2350       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@metcoder95 metcoder95 left a comment

Choose a reason for hiding this comment

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

lint seems failing

@hxinhan
Copy link
Contributor Author

hxinhan commented Mar 2, 2026

Attempted to fix linting issue

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

still lgtm

@metcoder95 metcoder95 merged commit f734c87 into nodejs:main Mar 3, 2026
35 of 37 checks passed
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.

4 participants