Skip to content

Commit

Permalink
adding param asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
gpolak committed Feb 12, 2015
1 parent d1a74cc commit dc2edb1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion GPUberView/GPUberViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ - (id)initWithServerToken:(NSString *)serverToken
clientId:(NSString *)clientId
start:(CLLocationCoordinate2D)start
end:(CLLocationCoordinate2D)end {
// TODO: add asserts for params

if (serverToken.length == 0)
[NSException raise:NSInvalidArgumentException format:@"invalid server token:%@", serverToken];
if (!CLLocationCoordinate2DIsValid(start))
[NSException raise:NSInvalidArgumentException format:@"invalid start (%f, %f)", start.latitude, start.longitude];
if (!CLLocationCoordinate2DIsValid(end))
[NSException raise:NSInvalidArgumentException format:@"invalid end (%f, %f)", end.latitude, end.longitude];


self = [super initWithNibName:nil bundle:nil];
if (self) {
Expand Down

0 comments on commit dc2edb1

Please sign in to comment.