Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in FormEntryViewModel.openHierarchy (FormEntryViewModel.java:168) #4335

Closed
grzesiek2010 opened this issue Jan 8, 2021 · 0 comments
Closed

Comments

@grzesiek2010
Copy link
Member

grzesiek2010 commented Jan 8, 2021

Problem description

https://console.firebase.google.com/u/0/project/api-project-322300403941/crashlytics/app/android:org.odk.collect.android/issues/03147c13c9da44fbcac20c45245ab68a?time=last-thirty-days&versions=v1.29.2%20(4041)&sessionEventKey=5FF5E1EA03250001636881A4C1C3828B_1493128585116586318

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'org.odk.collect.android.formentry.audit.AuditEventLogger org.odk.collect.android.javarosawrapper.FormController.getAuditEventLogger()' on a null object reference
       at org.odk.collect.android.formentry.FormEntryViewModel.openHierarchy(FormEntryViewModel.java:168)
       at org.odk.collect.android.formentry.FormEntryMenuDelegate.onOptionsItemSelected(FormEntryMenuDelegate.java:130)
       at org.odk.collect.android.activities.FormEntryActivity.onOptionsItemSelected(FormEntryActivity.java:1035)
       at android.app.Activity.onMenuItemSelected(Activity.java:3274)
       at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:383)
       at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:228)
       at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
       at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
       at androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:65)
       at androidx.appcompat.widget.Toolbar$1.onMenuItemClick(Toolbar.java:207)
       at androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:779)

in logs we can find this:

E/null: java.lang.IllegalStateException: ensureFormController called before formLoaded

that indicates formController in FormEntryViewModel is null and it tries to get it from the application class (fix #4328) but it's still null.

What's interesting all the reports (except of the first one) don't contain any logs about displayed screens what is normal in case of any other crashes. Would that maybe indicated that the app is started form an external app and a user is able to open the hierarchy view before formConreoller is set? I wasn't able to reproduce such a scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant