diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-07-25 22:01:25 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2018-07-25 22:01:25 +0200 |
commit | c1e791bad0b079af67398f6407221e6dcbb573dd (patch) | |
tree | 82e5944b4458dd35aa482a38f6b650eb93bb89ad /server/lib/video-comment.ts | |
parent | 5f7021c33d31c5255b995ae0ff86b5bbea4ea4b9 (diff) | |
download | PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.tar.gz PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.tar.zst PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.zip |
expliciting type checks and predicates (server only)
Diffstat (limited to 'server/lib/video-comment.ts')
-rw-r--r-- | server/lib/video-comment.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/video-comment.ts b/server/lib/video-comment.ts index f88e5cfdf..70ba7c303 100644 --- a/server/lib/video-comment.ts +++ b/server/lib/video-comment.ts | |||
@@ -9,14 +9,14 @@ import { sendCreateVideoComment } from './activitypub/send' | |||
9 | 9 | ||
10 | async function createVideoComment (obj: { | 10 | async function createVideoComment (obj: { |
11 | text: string, | 11 | text: string, |
12 | inReplyToComment: VideoCommentModel, | 12 | inReplyToComment: VideoCommentModel | null, |
13 | video: VideoModel | 13 | video: VideoModel |
14 | account: AccountModel | 14 | account: AccountModel |
15 | }, t: Sequelize.Transaction) { | 15 | }, t: Sequelize.Transaction) { |
16 | let originCommentId: number = null | 16 | let originCommentId: number | null = null |
17 | let inReplyToCommentId: number = null | 17 | let inReplyToCommentId: number | null = null |
18 | 18 | ||
19 | if (obj.inReplyToComment) { | 19 | if (obj.inReplyToComment && obj.inReplyToComment !== null) { |
20 | originCommentId = obj.inReplyToComment.originCommentId || obj.inReplyToComment.id | 20 | originCommentId = obj.inReplyToComment.originCommentId || obj.inReplyToComment.id |
21 | inReplyToCommentId = obj.inReplyToComment.id | 21 | inReplyToCommentId = obj.inReplyToComment.id |
22 | } | 22 | } |