Skip to content

Commit

Permalink
fix: restricted nil assign of dataPlaneUrl and controlPlaneUrl (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pallab Maiti committed Apr 12, 2023
1 parent 6c54ed7 commit 0e28b6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Classes/RSConfigBuilder.m
Expand Up @@ -28,6 +28,8 @@ - (instancetype) withDataPlaneUrl: (NSString*) dataPlaneUrl {
if (config == nil) {
config = [[RSConfig alloc] init];
}
if (dataPlaneUrl == nil)
return self;

NSURL *url = [[NSURL alloc] initWithString:dataPlaneUrl];
if([RSUtils isValidURL:url]) {
Expand Down Expand Up @@ -167,6 +169,9 @@ - (instancetype)withControlPlaneUrl:(NSString *) controlPlaneUrl {
if (config == nil) {
config = [[RSConfig alloc] init];
}
if (controlPlaneUrl == nil)
return self;

NSURL *url = [[NSURL alloc] initWithString:controlPlaneUrl];
if([RSUtils isValidURL:url]) {
config.controlPlaneUrl = [RSUtils appendSlashToUrl: url.absoluteString];
Expand Down

0 comments on commit 0e28b6f

Please sign in to comment.