title: Volley string request error while passing string with null value as param
body: <p>I am using the following code for string request on volley</p>
  
  <pre><code>    pDialog = new ProgressDialog(context);
      pDialog.setMessage("Loading...");
      pDialog.setCancelable(false);
      pDialog.show();
      StringRequest strReq = new StringRequest(Method.POST,
          url, new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response) {
                  pDialog.dismiss();
                  Log.e(tag, response);                   
              }
          }, new Response.ErrorListener() {
  
              @Override
              public void onErrorResponse(VolleyError error) {
                  pDialog.dismiss();
              }
  
          }) {
  
          protected Map&lt;String, String&gt; getParams(){
              Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
              params.put("tag", "SHOW_FILE");
              params.put("filename",filename);
              return params;
          };
  
      };      
      // Adding request to request queue
      Application.getInstance().addToRequestQueue(strReq, "get_file");
  </code></pre>
  
  <p>If the variable filename=null, I am getting the following error:</p>
  
  <pre><code>08-02 10:28:06.192: E/Volley(2935): [2128] NetworkDispatcher.run: Unhandled exception java.lang.NullPointerException
  08-02 10:28:06.192: E/Volley(2935): java.lang.NullPointerException
  08-02 10:28:06.192: E/Volley(2935):     at libcore.net.UriCodec.encode(UriCodec.java:132)
  08-02 10:28:06.192: E/Volley(2935):     at java.net.URLEncoder.encode(URLEncoder.java:57)
  08-02 10:28:06.192: E/Volley(2935):     at com.android.volley.Request.encodeParameters(Request.java:449)
  08-02 10:28:06.192: E/Volley(2935):     at com.android.volley.Request.getBody(Request.java:435)
  08-02 10:28:06.192: E/Volley(2935):     at com.android.volley.toolbox.HurlStack.addBodyIfExists(HurlStack.java:236)
  08-02 10:28:06.192: E/Volley(2935):     at com.android.volley.toolbox.HurlStack.setConnectionParametersForRequest(HurlStack.java:210)
  08-02 10:28:06.192: E/Volley(2935):     at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:106)
  08-02 10:28:06.192: E/Volley(2935):     at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:93)
  08-02 10:28:06.192: E/Volley(2935):     at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:110)
  </code></pre>
  
  <p>Is there need a null value check on all param I POST or any other methods to solve this problem and handle with NULL value ?</p>