Permalink
Browse files

fix crash in getting content

  • Loading branch information...
1 parent 9b83b1f commit ba215cae921e302d6962c2bbadb097289d0a317a @yysun committed Nov 2, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 DataServices/RepositoryGraph.cs
  2. +1 −1 GitFileStatusTracker.cs
@@ -413,7 +413,7 @@ public byte[] GetFileContent(string commitId, string fileName)
RevTree revTree = head == null ? null : new RevWalk(repository).ParseTree(head);
var entry = TreeWalk.ForPath(repository, fileName, revTree);
- if (!entry.IsSubtree)
+ if (entry != null && !entry.IsSubtree)
{
var blob = repository.Open(entry.GetObjectId(0));
if (blob != null) return blob.GetCachedBytes();
View
@@ -310,7 +310,7 @@ public byte[] GetFileContent(string fileName)
if (revTree != null)
{
var entry = TreeWalk.ForPath(repository, fileName, revTree);
- if (!entry.IsSubtree)
+ if (entry != null && !entry.IsSubtree)
{
var blob = repository.Open(entry.GetObjectId(0));
if (blob != null) return blob.GetCachedBytes();

0 comments on commit ba215ca

Please sign in to comment.