diff options
author | desperateCoder <echotodevnull@gmail.com> | 2020-10-04 17:24:06 +0300 |
---|---|---|
committer | desperateCoder <echotodevnull@gmail.com> | 2020-10-04 17:24:06 +0300 |
commit | 47eb4edf3c666f0f93974dfa9f198f775529f6fd (patch) | |
tree | c5cb1babf5e084181207c90fc7a9976bd5c2e1eb /app/src/main/java/it/niedermann/nextcloud/deck/persistence | |
parent | 00d82daf51644dfa28e0f6764a61a4a10d609c51 (diff) |
#687 fixed another npe
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/persistence')
2 files changed, 13 insertions, 4 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 f964429b3..728aaacf8 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 @@ -914,9 +914,18 @@ public class SyncManager { stack.setBoardId(board.getLocalId()); fullStack.setStack(stack); fullStack.setAccountId(accountId); - if (board.getBoard().getId() != null) { - new DataPropagationHelper(serverAdapter, dataBaseAdapter).createEntity(new StackDataProvider(null, board), fullStack, getCallbackToLiveDataConverter(account, liveData)); - } + new DataPropagationHelper(serverAdapter, dataBaseAdapter).createEntity(new StackDataProvider(null, board), fullStack, new IResponseCallback<FullStack>(account) { + @Override + public void onResponse(FullStack response) { + liveData.postValue(response); + } + + @SuppressLint("MissingSuperCall") + @Override + public void onError(Throwable throwable, FullStack entity) { + liveData.postError(throwable, entity); + } + }); }); return liveData; } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/DataPropagationHelper.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/DataPropagationHelper.java index 9590f5abd..22e4e39fd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/DataPropagationHelper.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/DataPropagationHelper.java @@ -52,7 +52,7 @@ public class DataPropagationHelper { @Override public void onError(Throwable throwable) { super.onError(throwable); - new Thread(() -> callback.onError(throwable)).start(); + new Thread(() -> callback.onError(throwable, entity)).start(); } }, entity); } else { |