#vulnerable code 
                             private void printLine(SearchResult result){
		StringBuilder builder = new StringBuilder();
		
		HashMap<String, Object> extraFields = result.getExtraData();

		for (String tag : tagsOrder) {
			Object temp1 = extraFields.get(tag);

			String s = StringUtils.trimToEmpty(temp1.toString());
			
			if (s.length() > 0) {
				String temp = StringUtils.replaceEach(s, searchChars, replaceChars);
				builder.append(temp).append(";");
			} else {
				builder.append(";");
			}
		}
		
		log.debug("Printing Line: ", builder.toString());
		nLines++;
		this.writter.println(builder.toString());
	} 
                            #location 9 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private void printLine(SearchResult result){
		StringBuilder builder = new StringBuilder();
		
		HashMap<String, Object> extraFields = result.getExtraData();

		for (String tag : tagsOrder) {
			Object temp1 = extraFields.get(tag);

			String s = (temp1 != null) ? StringUtils.trimToEmpty(temp1.toString()) : "";
			
			if (s.length() > 0) {
				String temp = StringUtils.replaceEach(s, searchChars, replaceChars);
				builder.append(temp).append(";");
			} else {
				builder.append(";");
			}
		}
		
		log.debug("Printing Line: ", builder.toString());
		nLines++;
		this.writter.println(builder.toString());
	}