{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/litho/issues/434","repository_url":"https://api.github.com/repos/facebook/litho","labels_url":"https://api.github.com/repos/facebook/litho/issues/434/labels{/name}","comments_url":"https://api.github.com/repos/facebook/litho/issues/434/comments","events_url":"https://api.github.com/repos/facebook/litho/issues/434/events","html_url":"https://github.com/facebook/litho/issues/434","id":365171896,"node_id":"MDU6SXNzdWUzNjUxNzE4OTY=","number":434,"title":"a11y onPopulateAccessibilityEventHandler crash","user":{"login":"anushreeag","id":17777328,"node_id":"MDQ6VXNlcjE3Nzc3MzI4","avatar_url":"https://avatars2.githubusercontent.com/u/17777328?v=4","gravatar_id":"","url":"https://api.github.com/users/anushreeag","html_url":"https://github.com/anushreeag","followers_url":"https://api.github.com/users/anushreeag/followers","following_url":"https://api.github.com/users/anushreeag/following{/other_user}","gists_url":"https://api.github.com/users/anushreeag/gists{/gist_id}","starred_url":"https://api.github.com/users/anushreeag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anushreeag/subscriptions","organizations_url":"https://api.github.com/users/anushreeag/orgs","repos_url":"https://api.github.com/users/anushreeag/repos","events_url":"https://api.github.com/users/anushreeag/events{/privacy}","received_events_url":"https://api.github.com/users/anushreeag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-29T22:25:49Z","updated_at":"2018-10-01T18:47:47Z","closed_at":null,"author_association":"NONE","body":"- [ Yes ] I have searched [existing issues](https://github.com/facebook/litho/issues) and this is not a duplicate\r\n\r\n## Version\r\n    implementation 'com.facebook.litho:litho-core:0.15.0'\r\n    implementation 'com.facebook.litho:litho-widget:0.15.0'\r\n    compileOnly 'com.facebook.litho:litho-annotations:0.15.0'\r\n    annotationProcessor 'com.facebook.litho:litho-processor:0.15.0'\r\n\r\n## Issues and Steps to Reproduce\r\nApp crashes with a Null pointer exception : mHasEventDispatcher is null\r\nI am trying to use accessibility on text component using Litho.\r\nI have tried a sample application which has only text and added a onPopulateAccessibilityEvent in my Layout Spec class as mentioned in Litho accessibility document.\r\nThe application crashes only when Talkback is on.\r\n\r\n## Expected Behavior\r\nTalkback should work as expected and output of talkback should have \"Hi , I am TextView\"\r\nPlease let me know if anything is wrong.\r\n\r\n## Link to Code\r\nMainActivity.java\r\n```\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n  @Override\r\n  protected void onCreate(Bundle savedInstanceState) {\r\n    super.onCreate(savedInstanceState);\r\n    LithoView view = new LithoView(this);\r\n    ComponentContext context = view.getComponentContext();\r\n    Component component = MyComponent.create(context).onPopulateAccessibilityEventHandler(MyComponent.onPopulateAccessibilityEvent(context)).build();\r\n    setContentView(view.create(context,component));\r\n  }\r\n}\r\n```\r\n\r\nMyComponentSpec.java\r\n```\r\n@LayoutSpec\r\npublic class MyComponentSpec {\r\n  @OnCreateLayout\r\n  static Component onCreateLayout(ComponentContext c) {\r\n    return Text.create(c).text(\"Hi\").textSizeDip(30).build();\r\n  }\r\n\r\n  @OnEvent(OnPopulateAccessibilityEventEvent.class)\r\n  static void onPopulateAccessibilityEvent(\r\n      ComponentContext c,\r\n      @FromEvent View host,\r\n      @FromEvent AccessibilityEvent event,\r\n      @FromEvent AccessibilityDelegateCompat superDelegate) {\r\n    superDelegate.onPopulateAccessibilityEvent(host, event);\r\n    event.getText().add(\"Hi , I am TextView\");\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/litho/issues/comments/426019583","html_url":"https://github.com/facebook/litho/issues/434#issuecomment-426019583","issue_url":"https://api.github.com/repos/facebook/litho/issues/434","id":426019583,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjAxOTU4Mw==","user":{"login":"anushreeag","id":17777328,"node_id":"MDQ6VXNlcjE3Nzc3MzI4","avatar_url":"https://avatars2.githubusercontent.com/u/17777328?v=4","gravatar_id":"","url":"https://api.github.com/users/anushreeag","html_url":"https://github.com/anushreeag","followers_url":"https://api.github.com/users/anushreeag/followers","following_url":"https://api.github.com/users/anushreeag/following{/other_user}","gists_url":"https://api.github.com/users/anushreeag/gists{/gist_id}","starred_url":"https://api.github.com/users/anushreeag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anushreeag/subscriptions","organizations_url":"https://api.github.com/users/anushreeag/orgs","repos_url":"https://api.github.com/users/anushreeag/repos","events_url":"https://api.github.com/users/anushreeag/events{/privacy}","received_events_url":"https://api.github.com/users/anushreeag/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T18:47:47Z","updated_at":"2018-10-01T18:47:47Z","author_association":"NONE","body":"Crash Logs : \r\n\r\n    --------- beginning of crash\r\n2018-10-01 11:44:21.436 8105-8105/com.example.lithoexample E/AndroidRuntime: FATAL EXCEPTION: main\r\n    Process: com.example.lithoexample, PID: 8105\r\n    java.lang.NullPointerException: Attempt to invoke interface method 'com.facebook.litho.EventDispatcher com.facebook.litho.HasEventDispatcher.getEventDispatcher()' on a null object reference\r\n        at com.facebook.litho.EventDispatcherUtils.dispatchOnPopulateAccessibilityEvent(EventDispatcherUtils.java:301)\r\n        at com.facebook.litho.ComponentAccessibilityDelegate.onPopulateAccessibilityEvent(ComponentAccessibilityDelegate.java:281)\r\n        at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl$1.onPopulateAccessibilityEvent(AccessibilityDelegateCompat.java:132)\r\n        at android.view.View.onPopulateAccessibilityEvent(View.java:6446)\r\n        at android.view.View.dispatchPopulateAccessibilityEventInternal(View.java:6408)\r\n        at android.view.ViewGroup.dispatchPopulateAccessibilityEventInternal(ViewGroup.java:2950)\r\n        at android.view.View$AccessibilityDelegate.dispatchPopulateAccessibilityEvent(View.java:23510)\r\n        at android.support.v4.view.AccessibilityDelegateCompat.dispatchPopulateAccessibilityEvent(AccessibilityDelegateCompat.java:269)\r\n        at com.facebook.litho.ComponentAccessibilityDelegate.dispatchPopulateAccessibilityEvent(ComponentAccessibilityDelegate.java:275)\r\n        at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl$1.dispatchPopulateAccessibilityEvent(AccessibilityDelegateCompat.java:115)\r\n        at android.view.View.dispatchPopulateAccessibilityEvent(View.java:6394)\r\n        at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:6361)\r\n        at android.view.View$AccessibilityDelegate.sendAccessibilityEventUnchecked(View.java:23489)\r\n        at android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:248)\r\n        at com.facebook.litho.ComponentAccessibilityDelegate.sendAccessibilityEventUnchecked(ComponentAccessibilityDelegate.java:261)\r\n        at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl$1.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:148)\r\n        at android.view.View.sendAccessibilityEventUnchecked(View.java:6341)\r\n        at android.view.View.sendAccessibilityEventInternal(View.java:6320)\r\n        at android.view.View$AccessibilityDelegate.sendAccessibilityEvent(View.java:23447)\r\n        at android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEvent(AccessibilityDelegateCompat.java:226)\r\n        at com.facebook.litho.ComponentAccessibilityDelegate.sendAccessibilityEvent(ComponentAccessibilityDelegate.java:248)\r\n        at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl$1.sendAccessibilityEvent(AccessibilityDelegateCompat.java:143)\r\n        at android.view.View.sendAccessibilityEvent(View.java:6285)\r\n        at android.view.View.requestAccessibilityFocus(View.java:8956)\r\n        at android.view.View.performAccessibilityActionInternal(View.java:9645)\r\n        at android.view.View$AccessibilityDelegate.performAccessibilityAction(View.java:23467)\r\n        at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl.performAccessibilityAction(AccessibilityDelegateCompat.java:179)\r\n        at android.support.v4.view.AccessibilityDelegateCompat.performAccessibilityAction(AccessibilityDelegateCompat.java:391)\r\n        at com.facebook.litho.ComponentAccessibilityDelegate.performAccessibilityAction(ComponentAccessibilityDelegate.java:319)\r\n        at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl$1.performAccessibilityAction(AccessibilityDelegateCompat.java:161)\r\n        at android.view.View.performAccessibilityAction(View.java:9578)\r\n        at com.facebook.litho.ComponentHost.performAccessibilityAction(ComponentHost.java:1373)\r\n        at android.support.v4.view.ViewCompat$ViewCompatApi16Impl.performAccessibilityAction(ViewCompat.java:1047)\r\n        at android.support.v4.view.ViewCompat.performAccessibilityAction(ViewCompat.java:1994)\r\n        at android.support.v4.widget.ExploreByTouchHelper.performActionForHost(ExploreByTouchHelper.java:901)\r\n2018-10-01 11:44:21.436 8105-8105/com.example.lithoexample E/AndroidRuntime:     at android.support.v4.widget.ExploreByTouchHelper.performAction(ExploreByTouchHelper.java:894)\r\n        at android.support.v4.widget.ExploreByTouchHelper$MyNodeProvider.performAction(ExploreByTouchHelper.java:1248)\r\n        at android.support.v4.view.accessibility.AccessibilityNodeProviderCompat$AccessibilityNodeProviderKitKatImpl$1.performAction(AccessibilityNodeProviderCompat.java:107)\r\n        at android.support.v4.view.accessibility.AccessibilityNodeProviderCompatKitKat$1.performAction(AccessibilityNodeProviderCompatKitKat.java:59)\r\n        at android.view.AccessibilityInteractionController.performAccessibilityActionUiThread(AccessibilityInteractionController.java:664)\r\n        at android.view.AccessibilityInteractionController.-wrap6(AccessibilityInteractionController.java)\r\n        at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1201)\r\n        at android.os.Handler.dispatchMessage(Handler.java:102)\r\n        at android.os.Looper.loop(Looper.java:154)\r\n        at android.app.ActivityThread.main(ActivityThread.java:6119)\r\n        at java.lang.reflect.Method.invoke(Native Method)\r\n        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)\r\n        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)"}}
{"actor":{"display_login":"anushreeag"}}