File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1069,7 +1069,7 @@ + (void)proxySceneDelegateIfNeeded:(UIScene *)scene {
10691069
10701070 // Skip proxying if the class has a prefix of kGULAppDelegatePrefix, which means it has been
10711071 // proxied before.
1072- if ([className hasPrefix: kGULAppDelegatePrefix ]) {
1072+ if (className == nil || [className hasPrefix: kGULAppDelegatePrefix ]) {
10731073 return ;
10741074 }
10751075
Original file line number Diff line number Diff line change @@ -1319,6 +1319,14 @@ - (void)testAppDelegateIsProxiedIncludingAPNSMethodsWhenEnabled {
13191319
13201320#if ((TARGET_OS_IOS || TARGET_OS_TV) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 130000))
13211321
1322+ - (void )testProxySceneDelegateWithNoSceneDelegate {
1323+ if (@available (iOS 13 , tvOS 13 , *)) {
1324+ id mockSharedScene = OCMClassMock ([UIScene class ]);
1325+ OCMStub ([mockSharedScene delegate ]).andReturn (nil );
1326+ XCTAssertNoThrow ([GULAppDelegateSwizzler proxySceneDelegateIfNeeded: mockSharedScene]);
1327+ }
1328+ }
1329+
13221330- (void )testProxySceneDelegate {
13231331 if (@available (iOS 13 , tvOS 13 , *)) {
13241332 GULTestSceneDelegate *realSceneDelegate = [[GULTestSceneDelegate alloc ] init ];
You can’t perform that action at this time.
0 commit comments