#vulnerable code 
                             protected Object getId(Object entity) {
		entity = ProxyHelper.unwrap(entity);
		MappedClass mc;
		String keyClassName = entity.getClass().getName();
		if (mapr.getMappedClasses().containsKey(keyClassName))
			mc = mapr.getMappedClasses().get(keyClassName);
		else
			mc = new MappedClass(entity.getClass(), getMapper());
		
		try {
			return mc.getIdField().get(entity);
		} catch (Exception e) {
			return null;
		}
	} 
                            #location 11 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             protected Object getId(Object entity) {
		entity = ProxyHelper.unwrap(entity);
//		String keyClassName = entity.getClass().getName();
		MappedClass mc = mapr.getMappedClass(entity.getClass());
//		
//		if (mapr.getMappedClasses().containsKey(keyClassName))
//			mc = mapr.getMappedClasses().get(keyClassName);
//		else
//			mc = new MappedClass(entity.getClass(), getMapper());
//		
		try {
			return mc.getIdField().get(entity);
		} catch (Exception e) {
			return null;
		}
	}