ReceiveExternalFilesActivity: don't crash if no user present

Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey Vilas 2022-03-16 10:38:37 +01:00
parent e82fb2c6da
commit 3975839d53
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

@ -264,7 +264,9 @@ public class ReceiveExternalFilesActivity extends FileActivity
super.onSaveInstanceState(outState);
outState.putString(KEY_PARENTS, generatePath(mParents));
outState.putParcelable(KEY_FILE, mFile);
outState.putParcelable(FileActivity.EXTRA_USER, getUser().orElseThrow(RuntimeException::new));
if (getUser().isPresent()) {
outState.putParcelable(FileActivity.EXTRA_USER, getUser().orElseThrow(RuntimeException::new));
}
Log_OC.d(TAG, "onSaveInstanceState() end");
}