List<Map<String, Object>> pcList = null;
Map<String, Object> pcMap = new HashMap<String, Object>();
ComputerConfigurations tempPC = null;
if (historyList != null) {
Iterator<ComputerConfigurations> iterator = historyList.iterator();
while (iterator.hasNext()) {
tempPC = (ComputerConfigurations) iterator.next();
pcMap.put(tempPC.getEnvironment(), tempPC);
pcList.add((Map<String, Object>) pcMap);
}
}
I am getting null pointer exception on pcList.add((Map<String, Object>)pcMap);
line. [Servlet Error]-: java.lang.NullPointerException
. Any suggestion ?