Bug 1482

Summary: JavaCallback can throw NPE during invocation
Product: [JogAmp] Gluegen Reporter: Mathieu Féry (MathiusD) <mfery>
Component: coreAssignee: Mathieu Féry (MathiusD) <mfery>
Status: RESOLVED FIXED    
Severity: normal CC: rmanzini, sgothel
Priority: P4    
Version: 2.6.0   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
d56cd13883c2af1f42906a5327c78b1a7c684012 dccb9a85e39cf82bd32ef28cb0202e2d486328ec
Workaround: ---

Description Mathieu Féry (MathiusD) 2023-12-06 14:25:40 CET
When callback from native api are invoked, Gluegen dispatch event to JavaCallback registered and convert CompoundType into CompoundTypeWrapper related, but if native callback can pass NULL pointer, wrapping fail with NPE.

(Example : JOAL with ALC_SOFT_system_events, atm device parameter are always NULL)
Comment 1 Mathieu Féry (MathiusD) 2023-12-06 14:28:54 CET
I've made a patch available here : https://github.com/MathiusD/gluegen in 1482-npe-on-java-callback-call-with-native-null-ptr

Comparison link : https://github.com/JogAmp/gluegen/compare/master...MathiusD:gluegen:1482-npe-on-java-callback-call-with-native-null-ptr
Comment 2 Sven Gothel 2024-01-06 04:03:48 CET
Merged, thx