Skip to content

Commit

Permalink
Merge pull request #38 from SilverFire/patch-1
Browse files Browse the repository at this point in the history
Prevent NPE if a child is already dead
  • Loading branch information
agsh authored Jan 22, 2022
2 parents 209a790 + b1fcb5f commit 17964d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rtsp-ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ FFMpeg.prototype.start = function() {
* Stop ffmpeg spawn process
*/
FFMpeg.prototype.stop = function() {
this.child.kill();
if (this.child) {
this.child.kill();
}
delete this.child;
this.emit('stop');
};
Expand Down

0 comments on commit 17964d2

Please sign in to comment.