summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-03 17:47:03 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-03 17:48:49 -0400
commit0866e87ce6bdc0b621cbb0663728cf837970f94c (patch)
tree97a135458760380c03c52beacb601e3aa1b22cc5 /packages/backend/src/server/api
parentcopy changes to global channel (diff)
downloadsharkey-0866e87ce6bdc0b621cbb0663728cf837970f94c.tar.gz
sharkey-0866e87ce6bdc0b621cbb0663728cf837970f94c.tar.bz2
sharkey-0866e87ce6bdc0b621cbb0663728cf837970f94c.zip
fix null check in local/global/list channels
Diffstat (limited to 'packages/backend/src/server/api')
-rw-r--r--packages/backend/src/server/api/stream/channels/global-timeline.ts2
-rw-r--r--packages/backend/src/server/api/stream/channels/local-timeline.ts4
-rw-r--r--packages/backend/src/server/api/stream/channels/user-list.ts2
3 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts
index 515deb1253..bac0277538 100644
--- a/packages/backend/src/server/api/stream/channels/global-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts
@@ -65,7 +65,7 @@ class GlobalTimelineChannel extends Channel {
if (!this.isNoteVisibleToMe(reply)) return;
if (!this.following[note.userId]?.withReplies) {
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
- if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return;
+ if (reply.userId !== this.user?.id && !isMe && reply.userId !== note.userId) return;
}
}
diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts
index 70b02d9580..2eb3460efa 100644
--- a/packages/backend/src/server/api/stream/channels/local-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts
@@ -50,7 +50,7 @@ class LocalTimelineChannel extends Channel {
@bindThis
private async onNote(note: Packed<'Note'>) {
- const isMe = this.user!.id === note.userId;
+ const isMe = this.user?.id === note.userId;
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (!this.withBots && note.user.isBot) return;
@@ -69,7 +69,7 @@ class LocalTimelineChannel extends Channel {
if (!this.isNoteVisibleToMe(reply)) return;
if (!this.following[note.userId]?.withReplies) {
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
- if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return;
+ if (reply.userId !== this.user?.id && !isMe && reply.userId !== note.userId) return;
}
}
diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts
index 8a7c2b2633..06619d1208 100644
--- a/packages/backend/src/server/api/stream/channels/user-list.ts
+++ b/packages/backend/src/server/api/stream/channels/user-list.ts
@@ -81,7 +81,7 @@ class UserListChannel extends Channel {
@bindThis
private async onNote(note: Packed<'Note'>) {
- const isMe = this.user!.id === note.userId;
+ const isMe = this.user?.id === note.userId;
// チャンネル投稿は無視する
if (note.channelId) return;