Project: SWT
Bug 311302 NPE getting address of a Relation
Reported: 2010-05-01 23:37:04 | Status: resolved fixed

Set Accessible.DEBUG = true, then run LiveRegionExample and then run JAWS. NPE in Accessible.get_relation on the statement relation.objIAccessibleRelation.getAddress() because relation.objIAccessibleRelation is null. This is because relation.objIAccessibleRelation is created when AddRef is called, and it doesn't get called until the next line of code. It should not matter whether Relation's AddRef or getAddress is called first. The object should be created in getAddress if it was not created yet. Because of this bug, I noticed that some QueryInterface/getAddress() cleanup did not get done in the Relation class. The patch fixes both of these problems, and makes the code in Relation class consistent with the code in Accessible class.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Relation.java