Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6662] Android: NullPointerException when listening for click events for TiScrollView

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsandroid
Reportermartin
AssigneeAbir Mukherjee
Created2021-01-14T14:58:14.000+0000
Updated2021-01-14T14:58:14.000+0000

Description

The following example crashes the app with: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.titanium.proxy.TiViewProxy.hierarchyHasListener(java.lang.String)' on a null object reference at ti.modules.titanium.ui.widget.TiUIScrollView$TiScrollViewLayout$1.onSingleTapConfirmed(TiUIScrollView.java:82) at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:323) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
const win=Ti.UI.createWindow({
	backgroundColor:'white'
});
const view=Ti.UI.createScrollView({
	backgroundColor:'red'
});
view.addEventListener('click',()=>view.parent.remove(view));	
win.add(view); 
win.open();
Probably the fix in https://github.com/appcelerator/titanium_mobile/pull/8726 should be used also for TiScrollView.

Comments

No comments

JSON Source