#12 -- Fix NPE

merge-requests/8/head
Anton Romanov 3 years ago
parent 1b468746da
commit 797718ddc3

@ -91,6 +91,10 @@ public class Commit extends BaseEntity {
} }
public boolean containsEntity() { 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 @Transient
private boolean added; private boolean added;
private boolean containsEntity; private Boolean containsEntity;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "file_change_id", unique = true) @JoinColumn(name = "file_change_id", unique = true)
@ -79,7 +79,7 @@ public class FileChange extends BaseEntity {
return added; return added;
} }
public boolean isContainsEntity() { public Boolean isContainsEntity() {
return containsEntity; return containsEntity;
} }

Loading…
Cancel
Save