mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 03:36:44 +08:00
nil image guard [fixes SCI-1907]
This commit is contained in:
parent
7e2392f620
commit
a87c43e999
1 changed files with 6 additions and 0 deletions
|
@ -21,6 +21,9 @@ namespace :tiny_mce_asset do
|
|||
step.description.gsub!(regex) do |el|
|
||||
match = el.match(regex)
|
||||
old_img = TinyMceAsset.find_by_id(match[1])
|
||||
# skip other processing and deletes tiny_mce tag
|
||||
# if image is not in database
|
||||
next unless old_img
|
||||
new_img = TinyMceAsset.create(image: old_img.image,
|
||||
team: team,
|
||||
reference: step)
|
||||
|
@ -47,6 +50,9 @@ namespace :tiny_mce_asset do
|
|||
result_text.text.gsub!(regex) do |el|
|
||||
match = el.match(regex)
|
||||
old_img = TinyMceAsset.find_by_id(match[1])
|
||||
# skip other processing and deletes tiny_mce tag
|
||||
# if image is not in database
|
||||
next unless old_img
|
||||
new_img = TinyMceAsset.create(image: old_img.image,
|
||||
team: team,
|
||||
reference: result_text)
|
||||
|
|
Loading…
Reference in a new issue