mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 08:44:48 +08:00
FIX: Don't error when the empty current value in dif (#8406)
If current value is nil we should use `&.` combined with `dig` to protect diff from erroring It is happening when for example theme is delete (new value is empty)
This commit is contained in:

committed by
GitHub

parent
d0ad5ecc6d
commit
6e403f20ee
@ -90,5 +90,12 @@ describe Admin::StaffActionLogsController do
|
||||
|
||||
expect(parsed["side_by_side"]).not_to include("omit-dupe")
|
||||
end
|
||||
|
||||
it 'is not erroring when current value is empty' do
|
||||
theme = Fabricate(:theme)
|
||||
StaffActionLogger.new(admin).log_theme_destroy(theme)
|
||||
get "/admin/logs/staff_action_logs/#{UserHistory.last.id}/diff.json"
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user