#16 -- Fix npe

This commit is contained in:
Anton Romanov 2021-03-29 17:10:47 +04:00
parent a867c12b33
commit 50bc8aee9e

View File

@ -9,6 +9,7 @@ import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.List;
@Entity
@ -21,7 +22,7 @@ public class Branch extends BaseEntity {
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "branch_id", unique = true)
@Fetch(FetchMode.SUBSELECT)
private List<Commit> commits;
private List<Commit> commits = new ArrayList<>();
public Branch() {
}