Skip to content

Commit 6e95d94

Browse files
committed
StreamPipeToState::doWrite needs to handle a null write promise
rdar://164088592 https://bugs.webkit.org/show_bug.cgi?id=302067 Reviewed by Chris Dumez. In case of a worker, the write operation may result in an exception, leading to a null promise. In that case, we bail out. * Source/WebCore/Modules/streams/StreamPipeToUtilities.cpp: (WebCore::StreamPipeToState::doWrite): Canonical link: https://commits.webkit.org/302645@main
1 parent a211e26 commit 6e95d94

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Source/WebCore/Modules/streams/StreamPipeToUtilities.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ void StreamPipeToState::doWrite(JSC::JSValue value)
322322

323323
m_pendingReadRequest = nullptr;
324324
m_pendingWritePromise = writableStreamDefaultWriterWrite(m_writer, value);
325+
if (!m_pendingWritePromise)
326+
return;
327+
325328
RefPtr { m_pendingWritePromise }->markAsHandled();
326329

327330
loop();

0 commit comments

Comments
 (0)