diff options
author | desperateCoder <echotodevnull@gmail.com> | 2020-08-05 20:14:15 +0300 |
---|---|---|
committer | Niedermann IT-Dienstleistungen <stefan-niedermann@users.noreply.github.com> | 2020-08-09 17:34:18 +0300 |
commit | 04313044eeeac744dac850c5ef953d3e1082cb85 (patch) | |
tree | 3df61ef61101a4590443dfef237128fd1375569f /app | |
parent | ae00d7d9b07e6ef10256e039d485f0daa7402c7d (diff) |
#492 #631 fix the next NPE
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java index da86d4ba0..2f5629474 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java @@ -39,8 +39,10 @@ public class BoardDataProvider extends AbstractSyncDataProvider<FullBoard> { @Override public long createInDB(DataBaseAdapter dataBaseAdapter, long accountId, FullBoard entity) { handleOwner(dataBaseAdapter, accountId, entity); + Long localId = dataBaseAdapter.createBoardDirectly(accountId, entity.getBoard()); + entity.getBoard().setLocalId(localId); handleUsers(dataBaseAdapter, accountId, entity); - return dataBaseAdapter.createBoardDirectly(accountId, entity.getBoard()); + return localId; } private void handleOwner(DataBaseAdapter dataBaseAdapter, long accountId, FullBoard entity) { @@ -76,8 +78,8 @@ public class BoardDataProvider extends AbstractSyncDataProvider<FullBoard> { @Override public void updateInDB(DataBaseAdapter dataBaseAdapter, long accountId, FullBoard entity, boolean setStatus) { handleOwner(dataBaseAdapter, accountId, entity); - handleUsers(dataBaseAdapter, accountId, entity); dataBaseAdapter.updateBoard(entity.getBoard(), setStatus); + handleUsers(dataBaseAdapter, accountId, entity); } @Override |