Android: [3.4.0RC1] NPE on FileDetailSharingFragment.setShareWithUserInfo

Created on 7 Dec 2018  Â·  9Comments  Â·  Source: nextcloud/android

via GPlay Android 8.x:

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2946)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3046)
  at android.app.ActivityThread.-wrap11 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1688)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6798)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)
Caused by: java.lang.NullPointerException: 
  at com.owncloud.android.ui.fragment.FileDetailSharingFragment.setShareWithUserInfo (FileDetailSharingFragment.java:239)
  at com.owncloud.android.ui.fragment.FileDetailSharingFragment.setupView (FileDetailSharingFragment.java:196)
  at com.owncloud.android.ui.fragment.FileDetailSharingFragment.onCreateView (FileDetailSharingFragment.java:175)
  at android.support.v4.app.Fragment.performCreateView (Fragment.java:2439)
  at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1460)
  at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1784)
  at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1852)
  at android.support.v4.app.FragmentManagerImpl.dispatchStateChange (FragmentManager.java:3269)
  at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated (FragmentManager.java:3229)
  at android.support.v4.app.FragmentController.dispatchActivityCreated (FragmentController.java:201)
  at android.support.v4.app.FragmentActivity.onStart (FragmentActivity.java:620)
  at android.support.v7.app.AppCompatActivity.onStart (AppCompatActivity.java:178)
  at com.owncloud.android.ui.activity.BaseActivity.onStart (BaseActivity.java:188)
  at com.owncloud.android.ui.activity.DrawerActivity.onStart (DrawerActivity.java:1379)
  at com.owncloud.android.ui.activity.FileActivity.onStart (FileActivity.java:189)
  at com.owncloud.android.ui.activity.FileDisplayActivity.onStart (FileDisplayActivity.java:2564)
  at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1412)
  at android.app.Activity.performStart (Activity.java:7020)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2909)
bug pr exists release candidate

All 9 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/android/issues/2642 ([3.2.0RC1] Back from settings), https://github.com/nextcloud/android/issues/1979 (3.0RC1 Share Icon disappears), https://github.com/nextcloud/android/pull/3310 (3.4.0 RC1), https://github.com/nextcloud/android/issues/1456 (2.0RC5: java.lang.IllegalStateException - com.owncloud.android.ui.preview.PreviewImageFragment.onActivityCreated), and https://github.com/nextcloud/android/issues/541 (NoClassDefFoundError: android...JobScheduler).

Hm. Would be good to know which part of
shares = fileDataStorageManager.getSharesWithForAFile(file.getRemotePath(), account.name);
is causing NPE…

file is checked in constructor.
fileDisplayActivity is also checked in constructor, and from this we get fileDataStorageManager.

So it could be account? :thinking:

Maybe, yes. Can't say for sure either :/

If truly account is null then we cannot do anything, cause account is a crucial part…

I know, but we might then still want to rather show an error message in a Snackbar instead of creashing, no?

Sorry, I was too short.
We have this account nullable thing across the app from time to time.
Trying to handle this one by one will not work.
I suspect that this is coming from a strange app resume or that someone is deleting the account inbetween (which would be strange) or that the account is not accessible because of android…

that someone is deleting the account inbetween (which would be strange)

I tried this:

  • go into file detail sharing view
  • suspend app
  • remove account via settings
  • open app again
    --> no crash

:+1: for bulletproof
:-( for not finding the real cause

@tobiasKaminsky can't be really bullet proof if according to GPPlay 41 users are affected by this (unlikely that 41 users fiddled with the app/data), wide range of OEMs so it is also rather not related to an specific manufacturer while it is still reported for 8.0 and 8.1 only :/

Hehe, I meant that my test case was handled correctly (I did not expected this).
You are right, this particular bug needs to be fixed :/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndyScherzinger picture AndyScherzinger  Â·  3Comments

tobiasKaminsky picture tobiasKaminsky  Â·  3Comments

tobiasKaminsky picture tobiasKaminsky  Â·  3Comments

tobiasKaminsky picture tobiasKaminsky  Â·  3Comments

JSoko picture JSoko  Â·  3Comments