File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
app/src/main/java/it/niedermann/owncloud/notes/persistence Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -544,10 +544,15 @@ public Map<Long, Long> getIdMap(long accountId) {
544544 public void toggleFavoriteAndSync (Account account , Note note ) {
545545 executor .submit (() -> {
546546 try {
547+ final var noteWithContent = getNoteById (note .getId ());
548+ if (noteWithContent == null ) {
549+ return ;
550+ }
551+
547552 final var ssoAccount = AccountImporter .getSingleSignOnAccount (context , account .getAccountName ());
548553 final var notesAPI = apiProvider .getNotesAPI (context , ssoAccount , getPreferredApiVersion (account .getApiVersion ()));
549- note .setFavorite (!note .getFavorite ());
550- final var result = notesAPI .updateNote (note );
554+ noteWithContent .setFavorite (!noteWithContent .getFavorite ());
555+ final var result = notesAPI .updateNote (noteWithContent );
551556 final var response = result .execute ();
552557 if (response .isSuccessful ()) {
553558 final var updatedNote = response .body ();
You can’t perform that action at this time.
0 commit comments