diff --git a/iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OneSignalRequest.m b/iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OneSignalRequest.m index 4058129bf..65554094a 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OneSignalRequest.m +++ b/iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OneSignalRequest.m @@ -92,7 +92,7 @@ -(BOOL)missingAppId { if ([self.path containsString:@"apps/"]) { NSArray *pathComponents = [self.path componentsSeparatedByString:@"/"]; NSUInteger x = [pathComponents indexOfObject:@"apps"] + 1; // Find the index that follows "apps" in the path - return ([pathComponents count] < x || [[pathComponents objectAtIndex:x] length] == 0 || [[pathComponents objectAtIndex:x] isEqual: @"(null)"]); + return ([pathComponents count] <= x || [[pathComponents objectAtIndex:x] length] == 0 || [[pathComponents objectAtIndex:x] isEqual: @"(null)"]); } return (self.parameters[@"app_id"] == nil || [self.parameters[@"app_id"] length] == 0); diff --git a/iOS_SDK/OneSignalSDK/UnitTests/Shadows/OneSignalClientOverrider.m b/iOS_SDK/OneSignalSDK/UnitTests/Shadows/OneSignalClientOverrider.m index cf1376db9..6335329bd 100644 --- a/iOS_SDK/OneSignalSDK/UnitTests/Shadows/OneSignalClientOverrider.m +++ b/iOS_SDK/OneSignalSDK/UnitTests/Shadows/OneSignalClientOverrider.m @@ -217,7 +217,7 @@ + (void)finishExecutingRequest:(OneSignalRequest *)request onSuccess:(OSResultSu if ([request.urlRequest.URL.absoluteString containsString:@"apps/"]) { NSArray *pathComponents = [request.urlRequest.URL.absoluteString componentsSeparatedByString:@"/"]; NSUInteger x = [pathComponents indexOfObject:@"apps"] + 1; // Find the index that follows "apps" in the path - if ([pathComponents count] < x || [[pathComponents objectAtIndex:x] length] == 0 || [[pathComponents objectAtIndex:x] isEqual: @"(null)"]) { + if ([pathComponents count] <= x || [[pathComponents objectAtIndex:x] length] == 0 || [[pathComponents objectAtIndex:x] isEqual: @"(null)"]) { _XCTPrimitiveFail(currentTestInstance, @"All request must include an app_id"); } } else if (!parameters[@"app_id"]) {