🐛 Add missing WithService(nil) in setModerationStatus

The setModerationStatus command was missing the comment.WithService(nil)
call that all other comment commands have (delete, insert, list,
markAsSpam, update). This caused a nil pointer dereference when
calling SetModerationStatus() because the YouTube API service was
never initialized.

Fixes panic: runtime error: invalid memory address or nil pointer dereference

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Greg BandClaude authored and OpenWaygate committed 2026-01-22 23:06:29 +08:00
1 parent 818472a870
commit 03dce65e27
1 file changed
+1
+1
View File
@@ -142,6 +142,7 @@ func setModerationStatus(writer io.Writer) error {
comment.WithIDs(ids),
comment.WithModerationStatus(moderationStatus),
comment.WithBanAuthor(banAuthor),
comment.WithService(nil),
)
return c.SetModerationStatus(output, jpath, writer)