mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
FIX: do not revise post if post revision is not present
This commit is contained in:
parent
b44bcdefd9
commit
2e02a28ab4
@ -162,7 +162,8 @@ class PostDestroyer
|
||||
end
|
||||
|
||||
# has internal transactions, if we nest then there are some very high risk deadlocks
|
||||
@post.revise(@user, { raw: @post.revisions.last.modifications["raw"][0] }, force_new_version: true)
|
||||
last_revision = @post.revisions.last
|
||||
@post.revise(@user, { raw: last_revision.modifications["raw"][0] }, force_new_version: true) if last_revision.present?
|
||||
end
|
||||
|
||||
private
|
||||
|
Loading…
Reference in New Issue
Block a user