#12 -- Fix NPE
This commit is contained in:
parent
1b468746da
commit
797718ddc3
@ -91,6 +91,10 @@ public class Commit extends BaseEntity {
|
||||
}
|
||||
|
||||
public boolean containsEntity() {
|
||||
return fileChanges.stream().anyMatch(FileChange::isContainsEntity);
|
||||
return fileChanges != null && fileChanges.stream().anyMatch(
|
||||
fileChange -> fileChange != null
|
||||
&& fileChange.isContainsEntity() != null
|
||||
&& fileChange.isContainsEntity()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class FileChange extends BaseEntity {
|
||||
@Transient
|
||||
private boolean added;
|
||||
|
||||
private boolean containsEntity;
|
||||
private Boolean containsEntity;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "file_change_id", unique = true)
|
||||
@ -79,7 +79,7 @@ public class FileChange extends BaseEntity {
|
||||
return added;
|
||||
}
|
||||
|
||||
public boolean isContainsEntity() {
|
||||
public Boolean isContainsEntity() {
|
||||
return containsEntity;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user