File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ @implementation PBGitStash
19
19
if ((self = [super init ])) {
20
20
stashRawString = [stashLineFromStashListOutput retain ];
21
21
NSArray *lineComponents = [stashLineFromStashListOutput componentsSeparatedByString: @" :" ];
22
+ if ([lineComponents count ] != 3 ) {
23
+ [self release ];
24
+ return nil ;
25
+ }
22
26
name = [[lineComponents objectAtIndex: 0 ] retain ];
23
27
stashSourceMessage = [[[lineComponents objectAtIndex: 1 ] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet ]] retain ];
24
28
message = [[[lineComponents objectAtIndex: 2 ] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet ]] retain ];
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ - (void) reload {
46
46
if ([stashLine length ] == 0 )
47
47
continue ;
48
48
PBGitStash *stash = [[PBGitStash alloc ] initWithRawStashLine: stashLine];
49
- [loadedStashes addObject: stash];
49
+ if (stash != nil )
50
+ [loadedStashes addObject: stash];
50
51
[stash release ];
51
52
}
52
53
You can’t perform that action at this time.
0 commit comments