Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
fix(subtitlestream): return null instead of undefined when done
Browse files Browse the repository at this point in the history
  • Loading branch information
ttshivers committed Sep 28, 2020
1 parent da1a928 commit 1ae6dad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ async function* fetchLineGenerator(url, signal) {

const extractValue = async (nextPromise) => {
try {
const { value } = await nextPromise;
return value;
const { done, value } = await nextPromise;
return done
? null
: value;
} catch (e) {
return null;
}
Expand Down

0 comments on commit 1ae6dad

Please sign in to comment.