mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 23:15:34 +08:00
Merge pull request #1029 from Zanz2/empty_step_hash_fix
protocols io hash key instead of index bug in null step checker [SCI-2166]
This commit is contained in:
commit
ce860a740e
1 changed files with 5 additions and 2 deletions
|
@ -165,7 +165,11 @@ module ProtocolsIoHelper
|
|||
end
|
||||
|
||||
def step_hash_null?(step_json)
|
||||
step_json.dig(0, 'components', 0, 'component_type_id').nil?
|
||||
step_json.dig(
|
||||
0, 'components', 0, 'component_type_id'
|
||||
).nil? && step_json.dig(
|
||||
0, 'components', '0', 'component_type_id'
|
||||
).nil?
|
||||
end
|
||||
|
||||
# Images are allowed in:
|
||||
|
@ -350,7 +354,6 @@ module ProtocolsIoHelper
|
|||
return unordered_step_json if base_step.nil?
|
||||
number_of_steps = unordered_step_json.size
|
||||
return unordered_step_json if number_of_steps == 1
|
||||
base_step = unordered_step_json.find { |step| step['previous_guid'].nil? }
|
||||
step_order = []
|
||||
step_counter = 0
|
||||
step_order[step_counter] = base_step
|
||||
|
|
Loading…
Reference in a new issue