#vulnerable code 
                             public void onAdd() throws SearchLibException,
			UnsupportedEncodingException, ParseException, InterruptedException {
		synchronized (this) {
			if (getSelectedFile() != null) {
				// Already In
				if (getClient().getFilePathManager().getStrictPaths(
						getSelectedFile().getPath(), 0, 0, null) > 0) {
					Messagebox
							.show("Already In.", "Jaeksoft OpenSearchServer",
									Messagebox.OK,
									org.zkoss.zul.Messagebox.INFORMATION);
				} else {
					List<PathItem> list = FilePathManager.addPath(
							getSelectedFile().getPath(), getSelectedFile()
									.isDirectory()
									&& isSelectedFileCheck());

					if (list.size() > 0) {
						getClient().getFilePathManager().addList(list, false);
					}

					pathList = null;
					setSelectedFileCheck(false);
					setSelectedFilePath(null);
					reloadPage();
				}
			}
		}
	} 
                            #location 18 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public void onAdd() throws SearchLibException,
			UnsupportedEncodingException, ParseException, InterruptedException {
		synchronized (this) {
			if (getSelectedFile() != null) {
				// Already In
				if (getClient().getFilePathManager().getFilePaths(
						getSelectedFile().getPath(), 0, 0, null) > 0) {
					Messagebox
							.show("Already In.", "Jaeksoft OpenSearchServer",
									Messagebox.OK,
									org.zkoss.zul.Messagebox.INFORMATION);
				} else {
					/*
					 * List<FilePathItem> list = FilePathManager(
					 * getSelectedFile().getPath(), getSelectedFile()
					 * .isDirectory() && isSelectedFileCheck());
					 * 
					 * if (list.size() > 0) {
					 * getClient().getFilePathManager().addList(list, false); }
					 */
					pathList = null;
					setSelectedFileCheck(false);
					setSelectedFilePath(null);
					reloadPage();
				}
			}
		}
	}