Skip to content

Commit 865208e

Browse files
committed
Problem: failures when there's no :latest version
Solution: ensure we handle this case when trying deducing default information
1 parent 8e90ce2 commit 865208e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/pgpm/package/metadata.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ def broken?
2525

2626
module ClassMethods
2727
def extension_name
28-
self[:latest].extension_name
28+
self[:latest]&.extension_name
2929
end
3030

3131
def description
32-
self[:latest].description
32+
self[:latest]&.description
3333
end
3434

3535
def summary
36-
self[:latest].summary
36+
self[:latest]&.summary
3737
end
3838

3939
def license
40-
self[:latest].license
40+
self[:latest]&.license
4141
end
4242

4343
def all_searchable_texts
44-
self[:latest].all_searchable_texts
44+
self[:latest]&.all_searchable_texts || []
4545
end
4646
end
4747

0 commit comments

Comments
 (0)