#vulnerable code 
                             @Test
	public void testMultipartAsync() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException {
		Future<HttpResponse<JsonNode>> future = Unirest.post("http://httpbin.org/post")
		.field("file", new File(getClass().getResource("/test").toURI())).asJsonAsync(new Callback<JsonNode>() {
			
			public void failed(UnirestException e) {
				// TODO Auto-generated method stub
				
			}
			
			public void completed(HttpResponse<JsonNode> response) {
				assertTrue(response.getHeaders().size() > 0);
				assertTrue(response.getBody().toString().length() > 0);
				assertFalse(response.getRawBody() == null);
				assertEquals(200, response.getCode());
				
				JsonNode json = response.getBody();
				assertFalse(json.isArray());
				assertNotNull(json.getObject());
				assertNotNull(json.getArray());
				assertEquals(1, json.getArray().length());
				assertNotNull(json.getArray().get(0));
			}
			
			public void cancelled() {
				// TODO Auto-generated method stub
			}
			
		});
	
		HttpResponse<JsonNode> response = future.get();
		assertTrue(response.getHeaders().size() > 0);
		assertTrue(response.getBody().toString().length() > 0);
		assertFalse(response.getRawBody() == null);
		assertEquals(200, response.getCode());
		
		JsonNode json = response.getBody();
		assertFalse(json.isArray());
		assertNotNull(json.getObject());
		assertNotNull(json.getArray());
		assertEquals(1, json.getArray().length());
		assertNotNull(json.getArray().get(0));
//		assertNotNull(json.getObject().getJSONObject("files"));
	} 
                            #location 12 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @Test
	public void testMultipartAsync() throws JSONException, InterruptedException, ExecutionException, URISyntaxException, UnirestException {
		Unirest.post("http://httpbin.org/post")
		.field("name", "Mark")
		.field("file", new File(getClass().getResource("/test").toURI())).asJsonAsync(new Callback<JsonNode>() {
			
			public void failed(UnirestException e) {
				fail();
			}
			
			public void completed(HttpResponse<JsonNode> response) {
				assertTrue(response.getHeaders().size() > 0);
				assertTrue(response.getBody().toString().length() > 0);
				assertFalse(response.getRawBody() == null);
				assertEquals(200, response.getCode());
				
				JsonNode json = response.getBody();
				System.out.println(json);
				assertFalse(json.isArray());
				assertNotNull(json.getObject());
				assertNotNull(json.getArray());
				assertEquals(1, json.getArray().length());
				assertNotNull(json.getArray().get(0));
				
				assertEquals("This \nis \na \ntest \nfile", json.getObject().getJSONObject("files").getString("file"));
				assertEquals("Mark", json.getObject().getJSONObject("form").getString("name"));
				
				status = true;
				lock.countDown();
			}
			
			public void cancelled() {
				fail();
			}
			
		});
		
		lock.await(10, TimeUnit.SECONDS);
		assertTrue(status);
	}