Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#13263] Add null checks to methods in Student class #13264

Merged
merged 1 commit into from
Mar 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/teammates/storage/sqlentity/Student.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ public void setComments(String comments) {

@Override
public String getTeamName() {
return getTeam().getName();
return getTeam() != null ? getTeam().getName() : null;
}

@Override
public String getSectionName() {
return this.getTeam().getSection().getName();
return getTeam() != null ? getTeam().getSection() != null ? getTeam().getSection().getName() : null : null;
}

@Override
public Section getSection() {
return this.getTeam().getSection();
return getTeam() != null ? getTeam().getSection() : null;
}

@Override
Expand Down
Loading