Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Wrap md5sum in a try/catch

  • Loading branch information...
commit 911c5cb03cea01c3673f321a5af2779ee227fb05 1 parent 4fd9590
Paul Betts authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/library.rb
11 lib/library.rb
View
@@ -75,9 +75,14 @@ def load(files, progress_rate = 0.05)
# First, see if we've already scanned this file before (save some time
# and only read the first 256K)
- md5sum = Digest::MD5.hexdigest(File.open(current, 'r') {|x| x.read(0x40000)})
- if (@tag_info[current] = @md5_index[md5sum])
- #log DEBUG, "Cache hit!"
+ begin
+ md5sum = Digest::MD5.hexdigest(File.open(current, 'r') {|x| x.read(0x40000)})
+ if (@tag_info[current] = @md5_index[md5sum])
+ #log DEBUG, "Cache hit!"
+ next
+ end
+ rescue
+ @tag_info.delete current
next
end
Please sign in to comment.
Something went wrong with that request. Please try again.