fix(ThreadChannel): Handle possibly null parent (v13) (#8467)

This commit is contained in:
Jiralite
2022-08-10 19:17:21 +01:00
committed by GitHub
parent 78e494b06e
commit 2a46d9f58e
2 changed files with 5 additions and 4 deletions

View File

@@ -283,10 +283,11 @@ class ThreadChannel extends Channel {
* <info>This only works when the thread started from a message in the parent channel, otherwise the promise will
* reject. If you just need the id of that message, use {@link ThreadChannel#id} instead.</info>
* @param {BaseFetchOptions} [options] Additional options for this fetch
* @returns {Promise<Message>}
* @returns {Promise<Message|null>}
*/
fetchStarterMessage(options) {
return this.parent.messages.fetch(this.id, options);
// eslint-disable-next-line require-await
async fetchStarterMessage(options) {
return this.parent?.messages.fetch(this.id, options) ?? null;
}
/**