Skip to content

Commit 5746b22

Browse files
committed
Fix JSONObject["scopes"] is not a JSONArray error
1 parent 2bdb3eb commit 5746b22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/mushare/pluto/PlutoUser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public PlutoUser(JSONObject payload) {
3232
userId = payload.getLong("userId");
3333
deviceId = payload.getString("deviceId");
3434
scopes = new ArrayList<>();
35-
if (payload.containsKey("scopes")) {
35+
if (payload.containsKey("scopes") && payload.get("scopes") != null) {
3636
JSONArray scopeArray = payload.getJSONArray("scopes");
3737
for (int i = 0; i < scopeArray.size(); i++) {
3838
scopes.add(scopeArray.getString(i));

0 commit comments

Comments
 (0)