next.js
89996f10 - refactor: handle null RenderResult responses gracefully (#81895)

Commit
1 year ago
refactor: handle null RenderResult responses gracefully (#81895) ### What? - Removed unused `toUnchunkedBuffer` method from RenderResult - Changed null response handling to return empty values instead of throwing errors ### Why? The codebase now provides `RenderResult.EMPTY` for null responses, making it a valid state rather than an error condition. This change ensures consistent behavior across the rendering pipeline when dealing with empty responses. ### How? - Modified `toUnchunkedString()` to return empty string for null responses - Updated `coerce()` to return empty array for null responses - Fixed `chainStreams()` to return an empty stream when no streams are provided - Removed dead code that was no longer used This refactor improves error handling and simplifies the stream processing logic by treating empty/null responses as valid states.
Author
Parents
Loading