utility.presence: fix for activities that send empty timestamp objects

*cough* tower unite *cough*
This commit is contained in:
Cynthia Foxwell 2023-04-21 19:50:42 -06:00
parent c699c04717
commit d666a194c0
1 changed files with 4 additions and 1 deletions

View File

@ -838,7 +838,10 @@ presence.callback = async function (msg, line) {
descLines.push(
formatTime(activity.timestamps.end - Date.now()) + " remaining"
);
} else {
} else if (
activity.timestamps.start != null &&
activity.timestamps.end != null
) {
const position = Date.now() - activity.timestamps.start;
const length = activity.timestamps.end - activity.timestamps.start;