Skip to content

Commit 15194ce

Browse files
committed
fixed bug in RequestGetOrFormParameters
1 parent deabfbe commit 15194ce

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/main/java/net/b07z/sepia/server/core/server/RequestGetOrFormParameters.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,21 @@ public String[] getStringArray(String key) {
3333
@Override
3434
public JSONObject getJson(String key) {
3535
String jsonString = request.queryParams(key);
36-
return JSON.parseStringOrFail(jsonString);
36+
if (jsonString != null){
37+
return JSON.parseStringOrFail(jsonString);
38+
}else{
39+
return null;
40+
}
3741
}
3842

3943
@Override
4044
public JSONArray getJsonArray(String key) {
4145
String jsonString = request.queryParams(key);
42-
return JSON.parseStringToArrayOrFail(jsonString);
46+
if (jsonString != null){
47+
return JSON.parseStringToArrayOrFail(jsonString);
48+
}else{
49+
return null;
50+
}
4351
}
4452

4553
@Override

src/main/java/net/b07z/sepia/server/core/users/Account.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public boolean authenticate(JSONObject requestJson){
176176
*/
177177
/**
178178
* Authenticate the user. Copies basic user info to this class on successful authentication.
179-
* @param request - the request (aka URL parameters) sent to server.
179+
* @param params - {@RequestParameters}
180180
* @return true or false
181181
*/
182182
public boolean authenticate(RequestParameters params){

0 commit comments

Comments
 (0)