mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 10:18:59 +03:00
PreviewImageActivity: don't try to use virtual folder is type is NONE
Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
1954584741
commit
eeee11e427
2 changed files with 8 additions and 2 deletions
|
@ -60,6 +60,8 @@ import com.owncloud.android.ui.fragment.FileFragment;
|
|||
import com.owncloud.android.utils.MimeTypeUtil;
|
||||
import com.owncloud.android.utils.theme.ThemeToolbarUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -137,8 +139,9 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
|
||||
private void initViewPager(User user) {
|
||||
// virtual folder
|
||||
if (getIntent().getSerializableExtra(EXTRA_VIRTUAL_TYPE) != null) {
|
||||
VirtualFolderType type = (VirtualFolderType) getIntent().getSerializableExtra(EXTRA_VIRTUAL_TYPE);
|
||||
final Serializable virtualFolderType = getIntent().getSerializableExtra(EXTRA_VIRTUAL_TYPE);
|
||||
if (virtualFolderType != null && virtualFolderType != VirtualFolderType.NONE) {
|
||||
VirtualFolderType type = (VirtualFolderType) virtualFolderType;
|
||||
|
||||
mPreviewImagePagerAdapter = new PreviewImagePagerAdapter(getSupportFragmentManager(),
|
||||
type,
|
||||
|
|
|
@ -110,6 +110,9 @@ public class PreviewImagePagerAdapter extends FragmentStatePagerAdapter {
|
|||
if (type == null) {
|
||||
throw new IllegalArgumentException("NULL parent folder");
|
||||
}
|
||||
if(type == VirtualFolderType.NONE){
|
||||
throw new IllegalArgumentException("NONE virtual folder type");
|
||||
}
|
||||
if (storageManager == null) {
|
||||
throw new IllegalArgumentException("NULL storage manager");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue