Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
update EditContentTableTitle.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Mar 16, 2024
1 parent e89759f commit 35d7259
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.example.daemawiki.domain.revision.model.type.RevisionType;
import com.example.daemawiki.domain.user.model.User;
import com.example.daemawiki.domain.user.service.facade.UserFacade;
import com.example.daemawiki.global.exception.h404.ContentNotFoundException;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Scheduler;
Expand Down Expand Up @@ -56,7 +57,11 @@ private Mono<DefaultDocument> checkPermissionAndUpdateDocument(Tuple2<User, Defa
.filter(c -> c.getIndex().equals(request.index()))
.toList();

contents.getFirst().setTitle(request.newTitle());
if (contents.getFirst() != null){
contents.getFirst().setTitle(request.newTitle());
} else {
return Mono.error(ContentNotFoundException.EXCEPTION);
}

document.increaseVersion();
updateDocumentEditorAndUpdatedDate.execute(document, user);
Expand Down

0 comments on commit 35d7259

Please sign in to comment.