Skip to content

Commit b0ad5f4

Browse files
Copilotramereth
andcommitted
Fix NoMethodError in pg_ident parsing for non-matching lines
Co-authored-by: ramereth <[email protected]>
1 parent 7f3aea1 commit b0ad5f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libraries/ident.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ def self.read(file = 'pg_ident.conf', sort: true)
163163
def split_entries
164164
return if @ident_entries.empty?
165165

166-
@ident_entries.map! { |entry| SPLIT_REGEX.match(entry).named_captures.compact.transform_keys(&:to_sym) }
166+
@ident_entries.map! do |entry|
167+
match = SPLIT_REGEX.match(entry)
168+
match ? match.named_captures.compact.transform_keys(&:to_sym) : nil
169+
end
170+
@ident_entries.compact!
167171
end
168172

169173
def marshall_entries

0 commit comments

Comments
 (0)