#fixed code
                             public PreparedStatement prepareUpdateFields(Session session, EntityMeta entityMeta, List<PropertyMeta> pms) {

		log.trace("Generate prepared statement for UPDATE properties {}", pms);

		PropertyMeta idMeta = entityMeta.getIdMeta();
		Update update = update(entityMeta.getTableName());

		Assignments assignments = null;
		for (int i = 0; i < pms.size(); i++) {
			PropertyMeta pm = pms.get(i);
			if (i == 0) {
				assignments = update.with(set(pm.getPropertyName(), bindMarker()));
			} else {
				assignments.and(set(pm.getPropertyName(), bindMarker()));
			}
		}
		RegularStatement statement = prepareWhereClauseForUpdate(idMeta, assignments,true);
		return session.prepare(statement.getQueryString());
	}
#vulnerable code 
                             public PreparedStatement prepareUpdateFields(Session session, EntityMeta entityMeta, List<PropertyMeta> pms) {

		log.trace("Generate prepared statement for UPDATE properties {}", pms);

		PropertyMeta idMeta = entityMeta.getIdMeta();
		Update update = update(entityMeta.getTableName());

		Assignments assignments = null;
		for (int i = 0; i < pms.size(); i++) {
			PropertyMeta pm = pms.get(i);
			if (i == 0) {
				assignments = update.with(set(pm.getPropertyName(), bindMarker()));
			} else {
				assignments.and(set(pm.getPropertyName(), bindMarker()));
			}
		}
		RegularStatement statement = prepareWhereClauseForUpdate(idMeta, assignments);
		return session.prepare(statement.getQueryString());
	} 
                            #location 18 
                            #vulnerability type NULL_DEREFERENCE