I am getting a NullPointerException
at the modelData.add(i, es)
method. I know from debugging that es
isn\'t null
. I\'m r
Try
protected List<EventSeat> modelData = new ArrayList<EventSeat>();
On the first look, seems like modelData has not been instantiated. I would instantiate the modelData like:
protected List<EventSeat> modelData = new ArrayList<EventSeat>();
FYI.. In Java 7 there will be a new syntax you can use- someObject?.doSomething();
You need to initialize a List to not get the NullPointerException
.
protected List<EventSeat> modelData = new ArrayList<EventSeat>();