Merge pull request #4113 from nextcloud/detailNullable

Second fragment might be null
This commit is contained in:
Andy Scherzinger 2019-06-04 20:39:46 +02:00 committed by GitHub
commit af0dc69a83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,6 +141,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Locale;
import javax.annotation.Nullable;
import javax.inject.Inject;
import androidx.annotation.NonNull;
@ -703,7 +704,8 @@ public class FileDisplayActivity extends FileActivity
return null;
}
public FileFragment getSecondFragment() {
public @Nullable
FileFragment getSecondFragment() {
Fragment second = getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT);
if (second != null) {
return (FileFragment) second;
@ -2066,7 +2068,7 @@ public class FileDisplayActivity extends FileActivity
if (result.isSuccess()) {
updateFileFromDB();
refreshListOfFilesFragment(false);
} else if (fileDetailFragment.getView() != null) {
} else if (fileDetailFragment != null && fileDetailFragment.getView() != null) {
String errorResponse;
if (result.getData() != null && result.getData().size() > 0) {