You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oltu.apache.org by si...@apache.org on 2013/09/18 15:10:54 UTC
svn commit: r1524396 -
/oltu/trunk/oauth-2.0/jwt/src/main/java/org/apache/oltu/oauth2/jwt/JWTEntity.java
Author: simonetripodi
Date: Wed Sep 18 13:10:54 2013
New Revision: 1524396
URL: http://svn.apache.org/r1524396
Log:
fixed potential NPE when users pass a null type to cast the custom field value
Modified:
oltu/trunk/oauth-2.0/jwt/src/main/java/org/apache/oltu/oauth2/jwt/JWTEntity.java
Modified: oltu/trunk/oauth-2.0/jwt/src/main/java/org/apache/oltu/oauth2/jwt/JWTEntity.java
URL: http://svn.apache.org/viewvc/oltu/trunk/oauth-2.0/jwt/src/main/java/org/apache/oltu/oauth2/jwt/JWTEntity.java?rev=1524396&r1=1524395&r2=1524396&view=diff
==============================================================================
--- oltu/trunk/oauth-2.0/jwt/src/main/java/org/apache/oltu/oauth2/jwt/JWTEntity.java (original)
+++ oltu/trunk/oauth-2.0/jwt/src/main/java/org/apache/oltu/oauth2/jwt/JWTEntity.java Wed Sep 18 13:10:54 2013
@@ -47,6 +47,9 @@ public abstract class JWTEntity {
if (name == null) {
throw new IllegalArgumentException("Null custom field name not present in the registry.");
}
+ if (type == null) {
+ throw new IllegalArgumentException("Custom field value can not be casted to a null type.");
+ }
Object value = customFields.get(name);