Skip to content

Commit

Permalink
Be lenient of nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeabdullah committed Apr 2, 2012
1 parent e5e9618 commit fbbfa5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion KSUniformType.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

+ (id)uniformTypeWithFilenameExtension:(NSString *)extension;
+ (id)bestGuessUniformTypeForURL:(NSURL *)url;
+ (id)uniformTypeWithIdentifier:(NSString *)identifier;
+ (id)uniformTypeWithIdentifier:(NSString *)identifier; // lenient and handles nil identifier by returning nil

// KSUniformType returns the right to return nil should the identifier be unsuitable (a la NSURL). This doesn't happen at present though
// Designated initializer
Expand Down
1 change: 1 addition & 0 deletions KSUniformType.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ + (id)uniformTypeWithFilenameExtension:(NSString *)extension;

+ (id)uniformTypeWithIdentifier:(NSString *)identifier;
{
if (!identifier) return nil;
return [[[self alloc] initWithIdentifier:identifier] autorelease];
}

Expand Down

0 comments on commit fbbfa5e

Please sign in to comment.