fix: TypeError: Cannot read properties of null (reading 'pid')

This commit is contained in:
Elysia
2024-07-25 22:06:32 +07:00
parent 74f49ba92d
commit 65c5332eed

View File

@@ -137,7 +137,7 @@ class BaseDispatcher extends Writable {
if (this.player.dispatcher === this) this.player.dispatcher = null; if (this.player.dispatcher === this) this.player.dispatcher = null;
const { streams } = this; const { streams } = this;
if (streams.opus) streams.opus.destroy(); if (streams.opus) streams.opus.destroy();
if (streams.ffmpeg) { if (streams.ffmpeg?.process) {
const ffmpegPid = streams.ffmpeg.process.pid; // But it is ppid ;-; const ffmpegPid = streams.ffmpeg.process.pid; // But it is ppid ;-;
const args = streams.ffmpeg.process.spawnargs.slice(1).join(' '); // Skip ffmpeg const args = streams.ffmpeg.process.spawnargs.slice(1).join(' '); // Skip ffmpeg
find('name', 'ffmpeg', true).then(list => { find('name', 'ffmpeg', true).then(list => {