This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dustmuz's profile picture

Java Exception thrown: java.lang.NullPointerException

Started by Dustmuz, 03 December 2015 - 09:32 AM
Dustmuz #1
Posted 03 December 2015 - 10:32 AM
As the title says..

What does that mean

i know that it isnt the code i am using, as it hasnt changed, and worked yesterday afternoon when i last logged in..
Bomb Bloke #2
Posted 03 December 2015 - 10:56 AM
It means that there was an error in the code that your code calls. Likely that error was triggered by your code, and the script wouldn't've worked anyway, but you ideally would've got a more descriptive error.

It's difficult to elaborate without access to your code, but usually the problem can be found in the way that a script is attempting to use a third-party peripheral. Sprinkling random print statements throughout should allow you to narrow down which of your script lines is leading to the crash.
Dustmuz #3
Posted 03 December 2015 - 11:02 AM
i just wonder how it could be the code, since it worked when i logged off the server yesterday afternoon, and it worked.
and the pack we are using havent been updated..

nothing really changed, except its now the 3rd december instead of the 2nd :)/>

but the code is here
Edited on 03 December 2015 - 10:02 AM
Dustmuz #4
Posted 03 December 2015 - 01:16 PM
and now the code works again. without me changing anything at all
Bomb Bloke #5
Posted 03 December 2015 - 01:24 PM
My bet is on the reactor.setActive() calls. If it happens again, stick print statements before and after them, and consider checking on reactor.getConnected() before allowing your script to progress to its main loop. The reactor may not be ready for controlling immediately on chunkload, especially if it covers multiple chunks.
Dustmuz #6
Posted 03 December 2015 - 01:43 PM
I'll try that..

Thanks Bomb :)/>
Edited on 03 December 2015 - 12:44 PM