Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
File: prevent NullPointerException when open not-existing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Keesun Baik committed Aug 25, 2014
1 parent 986253d commit f7abb5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/playRepository/GitRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public static interface TreeWalkHandler {
public byte[] getRawFile(String revision, String path) throws IOException {
RevTree tree = new RevWalk(repository).parseTree(repository.resolve(revision));
TreeWalk treeWalk = TreeWalk.forPath(repository, path, tree);
if (treeWalk.isSubtree()) {
if (treeWalk == null || treeWalk.isSubtree()) {
return null;
} else {
return repository.open(treeWalk.getObjectId(0)).getBytes();
Expand Down

0 comments on commit f7abb5d

Please sign in to comment.