Skip to content

Commit 541aae1

Browse files
committed
SPR-5802 - NullPointerException when using @CookieValue annotation
1 parent 73b54f4 commit 541aae1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,12 @@ protected Object resolveCookieValue(String cookieName, Class paramType, NativeWe
600600
if (Cookie.class.isAssignableFrom(paramType)) {
601601
return cookieValue;
602602
}
603-
else {
603+
else if (cookieValue != null) {
604604
return cookieValue.getValue();
605605
}
606+
else {
607+
return null;
608+
}
606609
}
607610

608611
@Override

0 commit comments

Comments
 (0)