diff --git a/lib/rugged/repository.rb b/lib/rugged/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/rugged/repository.rb
+++ b/lib/rugged/repository.rb
@@ -156,7 +156,7 @@ module Rugged
       tree = Rugged::Commit.lookup(self, revision).tree
       begin
         blob_data = tree.path(path)
-      rescue Rugged::IndexerError
+      rescue Rugged::TreeError
         return nil
       end
       blob = Rugged::Blob.lookup(self, blob_data[:oid])
The error type changed, so we should rescue it.