I am using map collection in Java. My code is below;
public void example(String var){
Map<String, String> params = new LinkedHashMap<String, String>();
params.put("data", var);
String jsonResult = Jsoup.connect(url).ignoreContentType(true).data(params).execute().body();
}
When var is null, I take an error which is java.lang.IllegalArgumentException: Data value must not be null.
IllegalArgumentExceptionis not coming from theputstatement, can you please post your stack trace. Also split up your long chained function to multiple lines (issue must be in that line), so you can clearly see where the issue is..