Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Prevent NullPointerException in configgen (#325)
Browse files Browse the repository at this point in the history
fixes #316
  • Loading branch information
jmuk authored Aug 3, 2016
1 parent c170078 commit 116ed6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ public String getTemplatizedResourcePath() {
public static List<CollectionPattern> getCollectionPatternsFromMethod(Method method) {
List<CollectionPattern> collectionPatterns = new LinkedList<CollectionPattern>();
HttpAttribute httpAttr = method.getAttribute(HttpAttribute.KEY);
for (PathSegment pathSegment : httpAttr.getPath()) {
if (CollectionPattern.isValidCollectionPattern(pathSegment)) {
collectionPatterns.add(CollectionPattern.create((FieldSegment) pathSegment));
if (httpAttr != null) {
for (PathSegment pathSegment : httpAttr.getPath()) {
if (CollectionPattern.isValidCollectionPattern(pathSegment)) {
collectionPatterns.add(CollectionPattern.create((FieldSegment) pathSegment));
}
}
}
return collectionPatterns;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public Map<String, Object> generate(Method method) {
*/
private static boolean isIdempotent(Method method) {
HttpAttribute httpAttr = method.getAttribute(HttpAttribute.KEY);
if (httpAttr == null) {
return false;
}
MethodKind methodKind = httpAttr.getMethodKind();
return methodKind.isIdempotent();
}
Expand Down

0 comments on commit 116ed6c

Please sign in to comment.