Permalink
Browse files

Check if a repository is valid

  • Loading branch information...
1 parent 7f337cd commit ef6b506dc75dc3ca78ecc06994f31aabed9c0eca @pieter pieter committed Sep 20, 2008
Showing with 7 additions and 1 deletion.
  1. +4 −1 PBGitRepository.m
  2. +3 −0 PBRepositoryDocumentController.m
View
@@ -138,8 +138,11 @@ - (void) setup
- (id) initWithURL: (NSURL*) path andRevSpecifier:(PBGitRevSpecifier*) rev
{
- self = [self init];
NSURL* gitDirURL = [PBGitRepository gitDirForURL:path];
+ if (!gitDirURL)
+ return nil;
+
+ self = [self init];
[self setFileURL: gitDirURL];
[self setup];
@@ -36,6 +36,9 @@ - (id) openRepositoryAtLocation:(NSURL*) url RevSpecifier:(PBGitRevSpecifier*) r
id document = [self documentForURL:url];
if (!document) {
document = [[PBGitRepository alloc] initWithURL:url andRevSpecifier:rev];
+ if (!document)
+ return nil;
+
[self addDocument:document];
[document makeWindowControllers];
} else {

0 comments on commit ef6b506

Please sign in to comment.