mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 01:19:28 +01:00
JBR-9580 Fix crash in [MenuAccessibility accessibilityChildren]
* Add null checks for variables that can have null values to prevent hard crash * Add missing CHECK_EXCEPTION after JNI call * Add missing DeleteLocalRef for axComponent
This commit is contained in:
committed by
Nikita Provotorov
parent
51486e5db9
commit
96fcd9e591
@@ -67,9 +67,17 @@ static jclass sjc_CAccessibility = NULL;
|
||||
jobject axComponent = (*env)->CallStaticObjectMethod(env, sjc_CAccessibility,
|
||||
sjm_getCurrentAccessiblePopupMenu,
|
||||
fAccessible, fComponent);
|
||||
CHECK_EXCEPTION();
|
||||
if (axComponent == NULL) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
CommonComponentAccessibility *currentElement = [CommonComponentAccessibility createWithAccessible:axComponent
|
||||
withEnv:env withView:self->fView isCurrent:YES];
|
||||
(*env)->DeleteLocalRef(env, axComponent);
|
||||
if (currentElement == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSArray *children = [CommonComponentAccessibility childrenOfParent:currentElement
|
||||
withEnv:env
|
||||
|
||||
Reference in New Issue
Block a user