Skip to content

Commit a32bb3d

Browse files
committed
initialize by default CursorEntity.extra and CursorEntity.Extras.stats to avoid NPE
1 parent 93f3aab commit a32bb3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/arangodb/entity/CursorEntity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.arangodb.velocypack.VPackSlice;
2424

2525
import java.util.Collection;
26+
import java.util.Collections;
2627
import java.util.Map;
2728

2829
/**
@@ -34,7 +35,7 @@ public class CursorEntity implements Entity, MetaAware {
3435

3536
private String id;
3637
private Integer count;
37-
private Extras extra;
38+
private Extras extra = new Extras();
3839
private Boolean cached;
3940
private Boolean hasMore;
4041
private VPackSlice result;
@@ -120,7 +121,7 @@ public String getMessage() {
120121

121122
public static class Extras {
122123
private Stats stats;
123-
private Collection<Warning> warnings;
124+
private Collection<Warning> warnings = Collections.emptyList();
124125

125126
public Stats getStats() {
126127
return stats;

0 commit comments

Comments
 (0)