Skip to content

Commit

Permalink
Make sure URLs are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeabdullah committed Jun 3, 2014
1 parent da6d262 commit e452cba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion TestKSFileUtilities/TestKSURLComponents.m
Expand Up @@ -58,7 +58,13 @@ - (void)testURLStrings {

for (NSDictionary *properties in data) {

NSURL *url = [NSURL URLWithString:properties[@"String"] relativeToURL:[NSURL URLWithString:properties[@"baseURL"]]];
NSString *urlString = properties[@"String"];

NSURL *url = nil;
if (urlString) {
url = [NSURL URLWithString:properties[@"String"] relativeToURL:[NSURL URLWithString:properties[@"baseURL"]]];
STAssertNotNil(urlString, @"Been fed in an invalid URL string");
}

{{
KSURLComponents *components = [KSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
Expand Down

0 comments on commit e452cba

Please sign in to comment.