Skip to content

Commit 2c2f14e

Browse files
committed
#23 Add Default Values to Prevent NPEs
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent 8ae4f44 commit 2c2f14e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/io/securecodebox/persistence/defectdojo/model/PaginatedResult.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.fasterxml.jackson.annotation.JsonProperty;
88
import lombok.Data;
99

10+
import java.util.ArrayList;
1011
import java.util.List;
1112

1213
/**
@@ -19,12 +20,16 @@ public final class PaginatedResult<T extends Model> {
1920
@JsonProperty
2021
private int count;
2122

23+
/**
24+
* TODO: What does this contain? I would expect a number for the next page.
25+
* FIXME: If this provides an empty string to prevent NPE, then UserProfileServiceTest fails.
26+
*/
2227
@JsonProperty
2328
private String next;
2429

2530
@JsonProperty
26-
private String previous;
31+
private String previous = "";
2732

2833
@JsonProperty
29-
private List<T> results;
34+
private List<T> results = new ArrayList<>();
3035
}

0 commit comments

Comments
 (0)