I get a null pointer pointing to this code:I provide the method it is in (addCard(Card card)) with "this", so it shouldn't be null.
cards.add(card);
cards.add(card);
boolean dummy = cards.add(card);
public void addCard(Card card) { cards.add(card); lastCardSpot = cards.lastIndexOf(card); topCard = cards.get(lastCardSpot); }
public void addRow(int rownum) { for(int i = 1; i != 2; i++) { setVars(); if(!taken.takenCardNumAndSuit[randnum][suit]) { addObject(new Card(true,randnum,suitS,false),135+(80*rownum),165+(20*rownum)); taken.takenCardNumAndSuit[randnum][suit] = true; } else { if(!taken.takenCardNumAndSuit[randnum][suit]) { setVars(); addObject(new Card(true,randnum,suitS,false),135+(80*rownum),165+(20*rownum)); taken.takenCardNumAndSuit[randnum][suit] = true; } else { i--; } } } for(int i = 1; i != (7-rownum); i++) { setVars(); if(!taken.takenCardNumAndSuit[randnum][suit]) { addObject(new Card(false,randnum,suitS,false),135+((i+rownum)*80),165+(20*rownum)); taken.takenCardNumAndSuit[randnum][suit] = true; } else { setVars(); if(!taken.takenCardNumAndSuit[randnum][suit]) { addObject(new Card(false,randnum,suitS,false),135+((i+rownum)*80),165+(20*rownum)); taken.takenCardNumAndSuit[randnum][suit] = true; } else { i--; } } } }
public void act() { checkDrag(); if(!dragging && pad != null) { pad.addCard(this); } }