Fran 99 Posted February 16, 2015 Hi guys, need help with the following error (I am new to Java and scripting, so will appreciate if you can be explicit :-)) The player levelled up and the following exception error popped: java.lang.NullPointerException Can someone please guide me on how should I modify the code to avoid this? Thanks!
Nuclear Nezz 2062 Posted February 16, 2015 There's not much we can tell you without the stack trace, which should have been printed in the console. :x You're making a call somewhere on a null object. This would be like if you're getting nearby chickens and there are no chickens available and you call chicken.interact("Attack") anyway, it'll throw an NPE because chicken is null.
Polish Civil 90 Posted February 17, 2015 Dayum son, chance getting this error comparing to all other possible errors is like finding sand on beach. By avoiding this:Polish's advanced technique for no scopers 720 blaze it: if(object != null){ ... }
Dogerina 330 Posted February 17, 2015 Dayum son, chance getting this error comparing to all other possible errors is like finding sand on beach. By avoiding this: Polish's advanced technique for no scopers 720 blaze it: if(object != null){ ... } 840 double blaze it
Recommended Posts
Archived
This topic is now archived and is closed to further replies.