Skip to content

Commit

Permalink
fix startup due to database data
Browse files Browse the repository at this point in the history
  • Loading branch information
ritosilva committed Mar 19, 2023
1 parent aeb3d63 commit 4bbb798
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ public void setAssignedOrder(Integer assignedOrder) {
}

public void remove() {
this.codeOrderSlot.getOrderedSlots().remove(this);
this.codeOrderSlot = null;
if (this.codeOrderSlot != null) {
this.codeOrderSlot.getOrderedSlots().remove(this);
this.codeOrderSlot = null;
}
}

public boolean isCorrect() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ public void remove() {
throw new TutorException(QUESTION_ANSWER_HAS_DISCUSSION);
}

this.quizQuestion.getQuestionAnswers().remove(this);
this.quizQuestion = null;
if (this.quizQuestion != null) {
this.quizQuestion.getQuestionAnswers().remove(this);
this.quizQuestion = null;
}

if (this.answerDetails != null) {
this.answerDetails.remove();
Expand Down
4 changes: 2 additions & 2 deletions data/env/backend.dev.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SPRING.DATASOURCE.USERNAME=engineer
SPRING.DATASOURCE.PASSWORD=password

## Jpa
SPRING.JPA.DATABASE-PLATFORM=org.hibernate.dialect.PostgreSQL9Dialect
SPRING.JPA.DATABASE-PLATFORM=org.hibernate.dialect.PostgreSQLDialect

## Resources
FIGURES.DIR=./data/images/
Expand All @@ -18,4 +18,4 @@ OAUTH.CONSUMER.SECRET=<FENIX SECRET>
CALLBACK.URL=http://localhost:8081/login
BASE.URL=https://fenix.tecnico.ulisboa.pt

FRAUD.SERVICE.URL=http://fraud-service:5000/
FRAUD.SERVICE.URL=http://fraud-service:5000/

0 comments on commit 4bbb798

Please sign in to comment.