Skip to content

Commit

Permalink
fix(bot): make sure failed connect recordings arent being sent to sta…
Browse files Browse the repository at this point in the history
…ts by accident
  • Loading branch information
Snazzah committed Nov 25, 2024
1 parent 8edd9f0 commit 626e1f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/bot/src/modules/recorder/recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,11 @@ export default class Recording {
})
.catch((e) => this.recorder.logger.error(`Error writing end date to recording ${this.id}`, e));

const timestamp = process.hrtime(this.startTime!);
const time = timestamp[0] * 1000 + timestamp[1] / 1000000;
if (this.startedAt)
if (this.startedAt && this.startTime) {
const timestamp = process.hrtime(this.startTime!);
const time = timestamp[0] * 1000 + timestamp[1] / 1000000;
await onRecordingEnd(this.user.id, this.channel.guild.id, this.startedAt, time, this.autorecorded, !!this.webapp, false).catch(() => {});
}

// Reset nickname
if (this.recorder.client.config.craig.removeNickname) {
Expand Down

0 comments on commit 626e1f6

Please sign in to comment.