Skip to content

Commit

Permalink
fix: always initialize destroyArgs
Browse files Browse the repository at this point in the history
just in case `stream._destroy` is ever called by another stream
implementation

fixes #68
  • Loading branch information
fent committed Jun 23, 2023
1 parent f363cae commit 8ab07d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function Miniget(url: string | URL, options: Miniget.Options = {}): Miniget.Stre
stream.destroy(err);
};

let destroyArgs: any[];
let destroyArgs: any[] = [];
const streamDestroy = (err?: Error) => {
activeRequest.destroy(err);
activeDecodedStream?.unpipe(stream);
Expand Down

0 comments on commit 8ab07d6

Please sign in to comment.