Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Commit 8b4e6c7

Browse files
committed
fix NPE caused by missing credentials
This case was broken by the refactoring to allow User subclass injection, since it checks the User object's class for assignability. This check is now skipped if the value is null.
1 parent 3d25a19 commit 8b4e6c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

endpoints-framework/src/main/java/com/google/api/server/spi/request/ServletRequestParamReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected Object[] deserializeParams(JsonNode node) throws IOException, IllegalA
134134
if (User.class.isAssignableFrom(clazz)) {
135135
// User type parameter requires no Named annotation (ignored if present)
136136
User user = getUser();
137-
if (clazz.isAssignableFrom(user.getClass())) {
137+
if (user == null || clazz.isAssignableFrom(user.getClass())) {
138138
params[i] = user;
139139
logger.log(Level.FINE, "deserialize: User injected into param[{0}]", i);
140140
} else {

0 commit comments

Comments
 (0)