Skip to content

Commit eb1834c

Browse files
committed
fix: only delete comment when comment exists
1 parent 1d70289 commit eb1834c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

BackgroundProcessor/Processors/LinkProcessor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ private async Task ProcessLink(string redditPostId, int queuedItemId, Cancellati
104104
{
105105
_logger.LogDebug("Submission {RedditPostId} not found, skipping processing", redditPostLinkId);
106106
}
107-
else if (links.Count == 0 && maybeExistingComment.HasValue)
107+
else if (links.Count == 0)
108108
{
109-
await _commentBrowser.DeleteComment(CommentThing.CreateFromShortId(maybeExistingComment.Value));
109+
if (maybeExistingComment.HasValue)
110+
await _commentBrowser.DeleteComment(CommentThing.CreateFromShortId(maybeExistingComment.Value));
110111
}
111112
else
112113
{

0 commit comments

Comments
 (0)