You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At https://processing.org/reference/try.html the code is only catching IOException, if there is no file, the NullPointer will hang the execution. This is not user wrong neither is very friendly for novices, not processingISH way of doing things, I dare say :)
It's not a website issue is it?
cheers
The text was updated successfully, but these errors were encountered:
The reference could be amended to include a catch statement or an if statement to check for NullPointer. It's been a while since I've used Java but it should look something like this:
try {
line = reader.readLine();
} catch (IOExceptione) {
e.printStackTrace();
line = null;
} catch (NullPointern) {
line = null
}
Or something like this:
if (reader == NullPointer) {
// Don't read because file doesn't existnoLoop();
}
try {
line = reader.readLine();
} catch (IOExceptione) {
e.printStackTrace();
line = null;
}
if (line == null) {
// Stop reading because of an error or file is emptynoLoop();
}
At https://processing.org/reference/try.html the code is only catching
IOException
, if there is no file, theNullPointer
will hang the execution. This is not user wrong neither is very friendly for novices, not processingISH way of doing things, I dare say :)It's not a website issue is it?
cheers
The text was updated successfully, but these errors were encountered: