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 PATH
remote: . remote: .
specs: specs:
openlib (0.1.1) openlib (0.1.2)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/

View File

@@ -37,7 +37,7 @@ module Openlib
def data_data(req:) def data_data(req:)
case 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 else
data.dig(req.to_s) data.dig(req.to_s)
end end

View File

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