From 4eefe1552bb2e22c40f76a16af24160875618fd6 Mon Sep 17 00:00:00 2001 From: rj-david <30392688+rj-david@users.noreply.github.com> Date: Tue, 22 Mar 2022 01:56:30 +0800 Subject: [PATCH] Fix stream check (#60) Co-authored-by: Sindre Sorhus --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index bdbd77b..230be21 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,7 @@ const destroyCircular = ({ } // TODO: Use `stream.isReadable()` when targeting Node.js 18. - if (typeof value === 'object' && typeof value.pipe === 'function') { + if (value !== null && typeof value === 'object' && typeof value.pipe === 'function') { to[key] = '[object Stream]'; continue; }