File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -495,10 +495,19 @@ - (NSArray*)moxUnignoredChildren {
495
495
}
496
496
497
497
- (id <mozAccessible>)moxUnignoredParent {
498
- id nativeParent = [self moxParent ];
498
+ id <mozAccessible> nativeParent = [self moxParent ];
499
+ if (!nativeParent) {
500
+ return nil ;
501
+ }
499
502
500
503
if (![nativeParent isAccessibilityElement ]) {
501
- return [nativeParent moxUnignoredParent ];
504
+ if ([nativeParent conformsToProtocol: @protocol (MOXAccessible)] &&
505
+ [nativeParent respondsToSelector: @selector (moxUnignoredParent )]) {
506
+ // Cast away the protocol so we can cast to another protocol.
507
+ id bareNativeParent = nativeParent;
508
+ id <MOXAccessible> moxNativeParent = bareNativeParent;
509
+ return [moxNativeParent moxUnignoredParent ];
510
+ }
502
511
}
503
512
504
513
return GetObjectOrRepresentedView (nativeParent);
You can’t perform that action at this time.
0 commit comments