Skip to content

Commit 85da445

Browse files
author
Ben McLean
committed
Quickfix for empty request attributes
1 parent ad382a0 commit 85da445

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.classpath
33
.project
44
target/
5+
src/au/com/origma/perspectiveapi/v1alpha1/Main.java

src/au/com/origma/perspectiveapi/v1alpha1/models/AnalyzeCommentRequest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ public Builder requestedAttributes(Map<AttributeType, RequestedAttribute> reques
130130
}
131131

132132
public Builder addRequestedAttribute(AttributeType type, RequestedAttribute requestedAttribute) {
133-
requestedAttributes.put(type, requestedAttribute);
133+
if(requestedAttribute != null){
134+
requestedAttributes.put(type, requestedAttribute);
135+
}else{
136+
requestedAttributes.put(type, new RequestedAttribute());
137+
}
134138
return this;
135139
}
136140

0 commit comments

Comments
 (0)