Closed Dunbaratu closed 11 years ago
Agreed, what I'll do for now is put a couple of blanket try catches, that still log the error to the log file, and give a 'helpful' error message but allow the OS to continue on.
Thank you very much. This will make it a lot easier for me to track down some of the problems I've been having.
To re-create:
Open the terminal on a brand new craft you just put on the launchpad.
Open the debug console (alt-F12) to and click on the debug log and scroll it to the bottom so you'll see the log messages as they happen live.
Type "print target".
This causes a null pointer exception since you have no target currently selected. You see the null pointer exception appear in the debug log.
Now try using the terminal. You can't see what you type and are typing blind. Furthermore even if you type a proper command blindly, like LIST. or CEARSCREEN. - Then nothing happens. It's not running the commands you type. You have to toggle the power on the KOS unit off and on to clear the problem.
While I have been able to recreate this reliably by using "print target" as my test, I've also seen it lots of other places when null pointer exceptions happen. This is not an error report on the fact that print target generates a null pointer exception. That's bad but it's not what I'm trying to report here. What I'm reporting is the fact that KOS is not trapping its own null pointer exceptions and reacting to them gracefully. Given that KOS is under development I don't expect "get rid of all null pointer exceptions" to be something that will be achieved any time soon. What I'd rather see is "react to them more gracefully when they happen. Catch them and report them without breaking the mod."