diff --git a/src/core/apis/file.ts b/src/core/apis/file.ts index c93d0f8e..a6847ac7 100644 --- a/src/core/apis/file.ts +++ b/src/core/apis/file.ts @@ -434,9 +434,9 @@ export class NTQQFileApi { }; try { - if (this.core.apis.PacketApi.available && this.packetRkey?.[0] && this.packetRkey?.[1]) { - const rkey_expired_private = !this.packetRkey || this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000; - const rkey_expired_group = !this.packetRkey || this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000; + if (this.core.apis.PacketApi.available) { + const rkey_expired_private = !this.packetRkey || (this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000); + const rkey_expired_group = !this.packetRkey || (this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000); if (rkey_expired_private || rkey_expired_group) { this.packetRkey = await this.fetchRkeyWithRetry(); }