Skip to content

Commit

Permalink
prevent NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
darkv committed Dec 12, 2012
1 parent e06663d commit 020de63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,14 @@ public ObjectMatch tryUnmarshall(SerializerState state, Class clazz, Object jso)

public Object unmarshall(SerializerState state, Class clazz, Object o) throws UnmarshallException {
try {
JSONObject jso = (JSONObject) o;
JSONObject eoDict = jso;
if(jso.has("eo")) {
jso.getJSONObject("eo");
}
if (eoDict == null) {
if (o == null) {
throw new UnmarshallException("eo missing");
}
String gidString = jso.getString("gid");
JSONObject eoDict = (JSONObject) o;
if(eoDict.has("eo")) {
eoDict.getJSONObject("eo");
}
String gidString = eoDict.getString("gid");
if (gidString == null) {
throw new UnmarshallException("gid missing");
}
Expand Down
4 changes: 4 additions & 0 deletions Frameworks/Ajax/Ajax/Sources/org/jabsorb/JSONRPCBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,10 @@ private Method resolveMethod(HashMap methodMap, String methodName,
{
Method method[];

if (methodMap == null) {
return null;
}

// first, match soley by the method name and number of arguments passed in
// if there is a single match, return the single match
// if there is no match at all, return null
Expand Down

0 comments on commit 020de63

Please sign in to comment.