Skip to content

Commit 0fee931

Browse files
initial commit
1 parent e7cd41f commit 0fee931

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/docx/document.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ def initialize(path_or_io, options = {})
3737
@doc = Nokogiri::XML(@document_xml)
3838
load_styles
3939
yield(self) if block_given?
40+
rescue Zip::Error => e
41+
raise 'File not supported'
4042
ensure
41-
@zip.close
43+
@zip.close unless @zip.nil?
4244
end
4345

4446
# This stores the current global document properties, for now

0 commit comments

Comments
 (0)