Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Check if a repository is valid

  • Loading branch information...
commit ef6b506dc75dc3ca78ecc06994f31aabed9c0eca 1 parent 7f337cd
Pieter de Bie authored September 20, 2008
5  PBGitRepository.m
@@ -138,8 +138,11 @@ - (void) setup
138 138
 
139 139
 - (id) initWithURL: (NSURL*) path andRevSpecifier:(PBGitRevSpecifier*) rev
140 140
 {
141  
-	self = [self init];
142 141
 	NSURL* gitDirURL = [PBGitRepository gitDirForURL:path];
  142
+	if (!gitDirURL)
  143
+		return nil;
  144
+
  145
+	self = [self init];
143 146
 	[self setFileURL: gitDirURL];
144 147
 
145 148
 	[self setup];
3  PBRepositoryDocumentController.m
@@ -36,6 +36,9 @@ - (id) openRepositoryAtLocation:(NSURL*) url RevSpecifier:(PBGitRevSpecifier*) r
36 36
 	id document = [self documentForURL:url];
37 37
 	if (!document) {
38 38
 		document = [[PBGitRepository alloc] initWithURL:url	andRevSpecifier:rev];
  39
+		if (!document)
  40
+			return nil;
  41
+
39 42
 		[self addDocument:document];
40 43
 		[document makeWindowControllers];
41 44
 	} else {

0 notes on commit ef6b506

Please sign in to comment.
Something went wrong with that request. Please try again.