Bug fix for book with no authors publishers or subjects

This commit is contained in:
Dan Milne
2020-04-22 17:39:47 +10:00
parent 1f662bfcc8
commit 5b1de8a9b1
3 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
PATH
remote: .
specs:
openlib (0.1.1)
openlib (0.1.2)
GEM
remote: https://rubygems.org/

View File

@@ -37,7 +37,7 @@ module Openlib
def data_data(req:)
case req
when :authors, :publishers, :subjects then data.dig(req.to_s).map { |p| p.dig('name') }
when :authors, :publishers, :subjects then data.dig(req.to_s)&.map { |p| p.dig('name') }
else
data.dig(req.to_s)
end

View File

@@ -1,3 +1,3 @@
module Openlib
VERSION = "0.1.2"
VERSION = "0.1.3"
end