#vulnerable code 
                             @Override
	protected void doRequest(ServletTransaction transaction)
			throws ServletException {
		try {
			Client client = Client.getWebAppInstance();
			HttpServletRequest request = transaction.getServletRequest();
			String indexName = request.getParameter("index");
			String uniq = request.getParameter("uniq");
			Object result = null;
			if (uniq != null)
				result = deleteDoc(client, indexName, uniq);
			else
				result = doObjectRequest(request, indexName);
			PrintWriter pw = transaction.getWriter("UTF-8");
			pw.println(result);
		} catch (Exception e) {
			throw new ServletException(e);
		}
	} 
                            #location 11 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @Override
	protected void doRequest(ServletTransaction transaction)
			throws ServletException {
		try {
			Client client = Client.getWebAppInstance();
			HttpServletRequest request = transaction.getServletRequest();
			String indexName = request.getParameter("index");
			String uniq = request.getParameter("uniq");
			String docId = request.getParameter("docId");
			boolean byId = request.getParameter("byId") != null;
			Object result = null;
			if (uniq != null)
				result = deleteUniqDoc(client, indexName, uniq);
			else if (docId != null)
				result = deleteDocById(client, indexName, Integer
						.parseInt(docId));
			else
				result = doObjectRequest(request, indexName, byId);
			PrintWriter pw = transaction.getWriter("UTF-8");
			pw.println(result);
		} catch (Exception e) {
			throw new ServletException(e);
		}
	}