diff options
author | desperateCoder <echotodevnull@gmail.com> | 2020-07-27 18:53:19 +0300 |
---|---|---|
committer | desperateCoder <echotodevnull@gmail.com> | 2020-07-27 18:53:19 +0300 |
commit | 95c1c8f3cfb5debb8111f981bb580ce6170f18e7 (patch) | |
tree | 348f3fb428a8e68b4d7839c25dec685723f628a2 /app/src/main | |
parent | 1e411ee79db65dd4b9e206b8b9e0eaf3ad7d9bda (diff) |
hint for mismatching Account/User UID
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/exceptions/DeckException.java | 1 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/DeckException.java b/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/DeckException.java index 8c2904d2b..d9d8c5dde 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/DeckException.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/exceptions/DeckException.java @@ -5,6 +5,7 @@ public class DeckException extends IllegalArgumentException { public enum Hint { CAPABILITIES_NOT_PARSABLE, CAPABILITIES_VERSION_NOT_PARSABLE, + UNKNOWN_ACCOUNT_USER_ID } private Hint hint; 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 7d1432b4a..ee9241733 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 @@ -32,6 +32,7 @@ import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.api.GsonConfig; import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.api.LastSyncUtil; +import it.niedermann.nextcloud.deck.exceptions.DeckException; import it.niedermann.nextcloud.deck.exceptions.OfflineException; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; @@ -563,6 +564,11 @@ public class SyncManager { doAsync(() -> { Account originAccount = dataBaseAdapter.getAccountByIdDirectly(originAccountId); User newOwner = dataBaseAdapter.getUserByUidDirectly(originAccountId, originAccount.getUserName()); + if (newOwner == null) { + DeckException exception = new DeckException(DeckException.Hint.UNKNOWN_ACCOUNT_USER_ID, "User with Account-UID \""+originAccount.getUserName()+"\" not found."); + liveData.postError(exception); + return; + } FullBoard originalBoard = dataBaseAdapter.getFullBoardByLocalIdDirectly(originAccountId, originBoardLocalId); String newBoardTitleBaseName = originalBoard.getBoard().getTitle().trim(); int newBoardTitleCopyIndex = 0; |