lib/openc3/models/cvt_model.rb in openc3-5.19.0 vs lib/openc3/models/cvt_model.rb in openc3-5.20.0
- old
+ new
@@ -154,10 +154,16 @@
# If there is no limits then it returns nil which is acceptable
item_result[1] = hash["#{value_keys[-1]}__L"]
item_result[1] = item_result[1].intern if item_result[1] # Convert to symbol
end
else
- raise "Item '#{target_name} #{packet_name} #{value_keys[-1]}' does not exist" unless hash.key?(value_keys[-1])
+ # We didn't find a value but the packet hash contains the key so the item exists
+ # Thus set the result to nil so it comes back like a normal item
+ if hash.key?(value_keys[-1])
+ item_result[1] = nil
+ else
+ raise "Item '#{target_name} #{packet_name} #{value_keys[-1]}' does not exist"
+ end
end
end
results << item_result
end
results