lib/alexandria/ui/icons.rb in alexandria-book-collection-manager-0.7.1 vs lib/alexandria/ui/icons.rb in alexandria-book-collection-manager-0.7.2

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + # Copyright (C) 2004-2006 Laurent Sansonetti # Copyright (C) 2014-2016 Matijs van Zuijlen # # Alexandria is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -73,12 +75,10 @@ def self.cover(library, book) begin return BOOK_ICON if library.nil? filename = library.cover(book) - if File.exist?(filename) - return GdkPixbuf::Pixbuf.new(file: filename) - end + return GdkPixbuf::Pixbuf.new(file: filename) if File.exist?(filename) rescue => err # report load error; FIX should go to a Logger... puts err.message puts err.backtrace.join("\n> ") puts "Failed to load GdkPixbuf::Pixbuf, please ensure that from #{filename} is a valid image file"