diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-08-04 15:27:47 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-08-04 15:27:47 +0300 |
commit | 6ef5b91b4a583a79cabd79c69c579fb7f861defe (patch) | |
tree | 8ca6090c84e00597359a25850cb25acf658c085d /app/src/main | |
parent | 7833c29990f28eac14a3b4ca02628fc87eaf5779 (diff) |
version bump to 1.9.61.9.6
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main')
9 files changed, 17 insertions, 10 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java index 854c14da5..0e732b3f0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java @@ -1887,4 +1887,11 @@ public class SyncManager { private static class BooleanResultHolder { public boolean result = true; } + + /** + * FIXME https://github.com/stefan-niedermann/nextcloud-deck/issues/640 + */ + public static boolean ignoreExceptionOnVoidError(Throwable t) { + return t instanceof NullPointerException && "Attempt to invoke interface method 'void io.reactivex.disposables.Disposable.dispose()' on a null object reference".equals(t.getMessage()); + } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java index 6bdd4e30b..5ca6c7418 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java @@ -674,7 +674,7 @@ public class MainActivity extends BrandedActivity implements DeleteStackListener .setPositiveButton(R.string.simple_archive, (dialog, whichButton) -> { final WrappedLiveData<Void> archiveStackLiveData = syncManager.archiveCardsInStack(mainViewModel.getCurrentAccount().getId(), stackLocalId); observeOnce(archiveStackLiveData, this, (result) -> { - if (archiveStackLiveData.hasError()) { + if (archiveStackLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(archiveStackLiveData.getError())) { ExceptionDialogFragment.newInstance(archiveStackLiveData.getError(), mainViewModel.getCurrentAccount()).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } }); @@ -918,7 +918,7 @@ public class MainActivity extends BrandedActivity implements DeleteStackListener long stackId = stackAdapter.getItem(binding.viewPager.getCurrentItem()).getLocalId(); final WrappedLiveData<Void> deleteStackLiveData = syncManager.deleteStack(mainViewModel.getCurrentAccount().getId(), stackId, mainViewModel.getCurrentBoardLocalId()); observeOnce(deleteStackLiveData, this, (v) -> { - if (deleteStackLiveData.hasError()) { + if (deleteStackLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(deleteStackLiveData.getError())) { ExceptionDialogFragment.newInstance(deleteStackLiveData.getError(), mainViewModel.getCurrentAccount()).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } }); @@ -941,7 +941,7 @@ public class MainActivity extends BrandedActivity implements DeleteStackListener final WrappedLiveData<Void> deleteLiveData = syncManager.deleteBoard(board); observeOnce(deleteLiveData, this, (next) -> { - if (deleteLiveData.hasError()) { + if (deleteLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(deleteLiveData.getError())) { ExceptionDialogFragment.newInstance(deleteLiveData.getError(), mainViewModel.getCurrentAccount()).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } }); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java index c76e5eb79..ed55c2411 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActvitiy.java @@ -93,7 +93,7 @@ public class ArchivedBoardsActvitiy extends BrandedActivity implements DeleteBoa public void onBoardDeleted(Board board) { final WrappedLiveData<Void> deleteLiveData = syncManager.deleteBoard(board); observeOnce(deleteLiveData, this, (next) -> { - if (deleteLiveData.hasError()) { + if (deleteLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(deleteLiveData.getError())) { ExceptionDialogFragment.newInstance(deleteLiveData.getError(), viewModel.getCurrentAccount()).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } }); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsAdapter.java index a5a065cd1..324d8362c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedcards/ArchivedCardsAdapter.java @@ -45,7 +45,7 @@ public class ArchivedCardsAdapter extends CardAdapter { case R.id.action_card_delete: { final WrappedLiveData<Void> liveData = syncManager.deleteCard(fullCard.getCard()); observeOnce(liveData, lifecycleOwner, (next) -> { - if (liveData.hasError()) { + if (liveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(liveData.getError())) { ExceptionDialogFragment.newInstance(liveData.getError(), account).show(fragmentManager, ExceptionDialogFragment.class.getSimpleName()); } }); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java index 9c1d63195..e2320ca45 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java @@ -116,7 +116,7 @@ public class AccessControlDialogFragment extends BrandedDialogFragment implement final WrappedLiveData<Void> wrappedDeleteLiveData = syncManager.deleteAccessControl(ac); adapter.remove(ac); observeOnce(wrappedDeleteLiveData, this, (ignored) -> { - if (wrappedDeleteLiveData.hasError()) { + if (wrappedDeleteLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(wrappedDeleteLiveData.getError())) { DeckLog.logError(wrappedDeleteLiveData.getError()); BrandedSnackbar.make(requireView(), getString(R.string.error_revoking_ac, ac.getUser().getDisplayname()), Snackbar.LENGTH_LONG) .setAction(R.string.simple_more, v -> ExceptionDialogFragment.newInstance(wrappedDeleteLiveData.getError(), viewModel.getCurrentAccount()).show(getChildFragmentManager(), ExceptionDialogFragment.class.getSimpleName())) diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java index 3391c7a99..487ad4b4b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java @@ -143,7 +143,7 @@ public class ManageLabelsDialogFragment extends BrandedDialogFragment implements private void deleteLabel(@NonNull Label label) { final WrappedLiveData<Void> deleteLiveData = syncManager.deleteLabel(label); observeOnce(deleteLiveData, this, (v) -> { - if (deleteLiveData.hasError()) { + if (deleteLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(deleteLiveData.getError())) { final Throwable error = deleteLiveData.getError(); assert error != null; Toast.makeText(requireContext(), error.getLocalizedMessage(), Toast.LENGTH_LONG).show(); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java index 39dbbbdc6..ecb06c7a8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java @@ -229,7 +229,7 @@ public class CardAdapter extends RecyclerView.Adapter<AbstractCardViewHolder> im case R.id.action_card_delete: { final WrappedLiveData<Void> deleteLiveData = syncManager.deleteCard(fullCard.getCard()); observeOnce(deleteLiveData, lifecycleOwner, (v) -> { - if (deleteLiveData.hasError()) { + if (deleteLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(deleteLiveData.getError())) { ExceptionDialogFragment.newInstance(deleteLiveData.getError(), account).show(fragmentManager, ExceptionDialogFragment.class.getSimpleName()); } }); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java index 8cf948e6f..460682ca0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java @@ -264,7 +264,7 @@ public class CardAttachmentsFragment extends BrandedFragment implements Attachme if (!viewModel.isCreateMode() && attachment.getLocalId() != null) { final WrappedLiveData<Void> deleteLiveData = syncManager.deleteAttachmentOfCard(viewModel.getAccount().getId(), viewModel.getFullCard().getLocalId(), attachment.getLocalId()); observeOnce(deleteLiveData, this, (next) -> { - if (deleteLiveData.hasError()) { + if (deleteLiveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(deleteLiveData.getError())) { ExceptionDialogFragment.newInstance(deleteLiveData.getError(), viewModel.getAccount()).show(getChildFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } }); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java index 72c5ffc84..7b0d2f20f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java @@ -165,7 +165,7 @@ public class StackFragment extends BrandedFragment implements DragAndDropTab<Car public void move(long originAccountId, long originCardLocalId, long targetAccountId, long targetBoardLocalId, long targetStackLocalId) { WrappedLiveData<Void> liveData = syncManager.moveCard(originAccountId, originCardLocalId, targetAccountId, targetBoardLocalId, targetStackLocalId); observeOnce(liveData, requireActivity(), (next) -> { - if (liveData.hasError()) { + if (liveData.hasError() && !SyncManager.ignoreExceptionOnVoidError(liveData.getError())) { ExceptionDialogFragment.newInstance(liveData.getError(), null).show(getChildFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } else { DeckLog.log("Moved " + Card.class.getSimpleName() + " \"" + originCardLocalId + "\" to " + Stack.class.getSimpleName() + " \"" + targetStackLocalId + "\""); |