From 8dbee56b3876ab7b083051327953cf2be3b96d30 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 2 Jan 2017 20:04:22 -0800 Subject: [PATCH] Fix deleting comments already deleted --- rophako/model/comment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rophako/model/comment.py b/rophako/model/comment.py index a8fa05b..53c9766 100644 --- a/rophako/model/comment.py +++ b/rophako/model/comment.py @@ -155,8 +155,9 @@ def update_comment(thread, cid, data): def delete_comment(thread, cid): """Delete a comment from a thread.""" comments = get_comments(thread) - del comments[cid] - write_comments(thread, comments) + if cid in comments: + del comments[cid] + write_comments(thread, comments) def make_quick_delete_token(thread, cid):