Skip to content

Commit cce4ddd

Browse files
committed
fix: prevent error when lookup is balnk for an additional info group
1 parent 3736b50 commit cce4ddd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/tracking_number/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,10 @@ def matching_additional
235235

236236
additional.each do |additional_info|
237237
next unless matches && matches.length > 0 # skip if no match groups
238+
238239
value = matches[additional_info[:regex_group_name]].gsub(/\s/, '') # match is empty
239240
next unless value
241+
next unless additional_info[:lookup]
240242

241243
matches = additional_info[:lookup].find do |i|
242244
if i[:matches]

0 commit comments

Comments
 (0)