Results 1 to 4 of 4
Thread: nullpointerexception
- 01-14-2012, 09:10 PM #1
Member
- Join Date
- Jan 2009
- Posts
- 33
- Rep Power
- 0
-
Re: nullpointerexception
You look to have enough information to solve this yourself. Either enemylist or the return from its values() method is null. Test for this just above this line, and then trace back in your code to see why its null.
By test, I've done something like:
Java Code:System.out.println("is enemylist null?: " + (enemylist == null)); System.out.println("is enemylist.values() null?: " + (enemylist.values() == null)); // original line: Iterator<createEnemy> el = enemylist.values().iterator();
- 01-14-2012, 09:46 PM #3
Member
- Join Date
- Jan 2009
- Posts
- 33
- Rep Power
- 0
Re: nullpointerexception
what I did was - if enemylist != null {} and that worked
-
Re: nullpointerexception
Some questions may still be though why was that variable null? And is it OK for it not to be null at that point in your program?
Similar Threads
-
NullPointerException
By maxspyderweb in forum New To JavaReplies: 5Last Post: 03-02-2011, 10:42 AM -
NullPointerException
By s0meb0dy in forum New To JavaReplies: 3Last Post: 10-09-2010, 08:12 PM -
NullPointerException
By Juuno in forum New To JavaReplies: 1Last Post: 02-11-2010, 05:43 PM -
NullPointerException help me!
By phancuong87 in forum New To JavaReplies: 4Last Post: 01-19-2010, 04:01 PM -
NullPointerException
By Aika in forum New To JavaReplies: 8Last Post: 11-18-2008, 11:34 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks