Skip to content

Commit 65aadb9

Browse files
committed
Check for JSONObject.NULL before casting to String [Fixes parse-community#209]
1 parent fe08345 commit 65aadb9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Parse/src/main/java/com/parse/ParseUser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ public Builder newBuilder() {
131131
}
132132

133133
public String sessionToken() {
134-
return (String) get(KEY_SESSION_TOKEN);
134+
Object value = get(KEY_SESSION_TOKEN);
135+
if (!(value instanceof String)) {
136+
return null;
137+
}
138+
return (String) value;
135139
}
136140

137141
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)