截击:[355] NetworkDispatcher.processRequest:未处理的异常 java.lang.IllegalArgumentException

Volley: [355] NetworkDispatcher.processRequest: Unhandled exception java.lang.IllegalArgumentException

你好我正在尝试运行下面的代码post数据到在线MySQL数据库

    if (data.getCount() > 0) {
                    data.moveToFirst();
                    do {
                        save(orderId,client, data.getString(0),data.getString(3),String.valueOf(finalCost),data.getString(4),longitude,latitude,"_",progressDialog);
                    } while (data.moveToNext());
                       data.close();
                    mydb.clearCart();

    private void save(final String orderId, final String client, final String prodid, final String Seller, final String amount, final String quantity, final double longi, final double lat, final String location, final ProgressDialog progressDialog) {
    String URL_ORDER = "https://foodfuzz.co.ke/foodfuzzbackend/market/orders/order.php";
    StringRequest orderStringRequest = new StringRequest(Request.Method.POST, URL_ORDER,
            //android M

            new Response.Listener<String>() {
                @Override
                public void onResponse(String response) {
                    try {
                        JSONObject orderObject = new JSONObject(response);
                        String orderSuccess = orderObject.getString("success");
                        if(orderSuccess.equals("1")){
                            pay.setVisibility(View.GONE);
                            progressDialog.dismiss();
                            Toast.makeText(CheckOutActivity.this,"Order Placed Successfully " , Toast.LENGTH_SHORT).show();
                        }else{
                            Logger.getLogger("Error",orderObject.getString("message"));
                            pay.setVisibility(View.GONE);
                            progressDialog.dismiss();
                            Toast.makeText(CheckOutActivity.this,"Order failed "+orderObject.getString("message") , Toast.LENGTH_SHORT).show();
                        }
                    } catch (JSONException e) {
                        e.printStackTrace();
                        progressDialog.dismiss();
                        Toast.makeText(CheckOutActivity.this,"Unable to place order " + e.toString(), Toast.LENGTH_SHORT).show();
                        pay.setEnabled(true);
                    }
                }
            },
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    progressDialog.dismiss();
                    error.printStackTrace();
                    Toast.makeText(CheckOutActivity.this,"Error placing order " + error.toString(), Toast.LENGTH_SHORT).show();
                    pay.setEnabled(true);
                }
            }){
        protected Map<String, String> getParams() {
            Map<String, String> params = new HashMap<>();
            params.put("orderId",orderId);
            params.put("client", client);
            params.put("name", prodid);
            params.put("seller", Seller);
            params.put("amount", amount);
            params.put("quantity",quantity);
            params.put("longitude",String.valueOf(longi));
            params.put("latitude",String.valueOf(lat));
            params.put("location",location);
            return params;
        }
    };
    RequestQueue orderRequestQueue = Volley.newRequestQueue(this);
    orderRequestQueue.add(orderStringRequest);

}

数据来自正在正确检索的 sqlite 数据库。当我 运行 在 android 小于 26 的版本上它工作正常但在大于 26 的版本上我得到下面的错误

    2019-10-30 17:57:45.206 8589-8697/com.otemainc.foodfuzzapp E/Volley: [355] NetworkDispatcher.processRequest: Unhandled exception java.lang.IllegalArgumentException: Request#getParams() or Request#getPostParams() returned a map containing a null key or value: (client, null). All keys and values must be non-null.
java.lang.IllegalArgumentException: Request#getParams() or Request#getPostParams() returned a map containing a null key or value: (client, null). All keys and values must be non-null.
    at com.android.volley.Request.encodeParameters(Request.java:478)
    at com.android.volley.Request.getBody(Request.java:466)
    at com.android.volley.toolbox.HurlStack.addBodyIfExists(HurlStack.java:275)
    at com.android.volley.toolbox.HurlStack.setConnectionParametersForRequest(HurlStack.java:249)
    at com.android.volley.toolbox.HurlStack.executeRequest(HurlStack.java:94)
    at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:123)
    at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:131)
    at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
    at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)

是否需要更新我的代码以适应新版本?如果是,那是什么?

它在堆栈跟踪中说

java.lang.IllegalArgumentException: Request#getParams() or Request#getPostParams() returned a map containing a null key or value: (client, null). All keys and values must be non-null.

protected Map<String, String> getParams() {
    Map<String, String> params = new HashMap<>();
    params.put("orderId",orderId);
    params.put("client", client);  // <<<  HERE
    params.put("name", prodid);
    params.put("seller", Seller);
    params.put("amount", amount);
    params.put("quantity",quantity);
    params.put("longitude",String.valueOf(longi));
    params.put("latitude",String.valueOf(lat));
    params.put("location",location);
    return params;
}

您的 client 值为 null 此处:params.put("client", client);