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
Edit-time error: 'The variable 'g' does not exist.'
Current Behavior
No edit-time error. Sometimes run-time error: 'NulPointerException' (sic).
Steps to Reproduce
In an empty sketch, enter
g=null;
on in a real sketch, accidentally include that statement out of scope of a declaration of g in the sketch.
Your Environment
Processing version:
3.3.6
Operating System and OS version:
Windows 7.
Possible Causes / Solutions
Processing's internal 'g' varaible leaking into the sketch's scope.
The text was updated successfully, but these errors were encountered:
chrisjj
changed the title
Undeclared variable 'g' not faulted and can lead to run-time errors.
Undeclared variable 'g' not faulted at edit time and can lead to run-time errors.
Feb 14, 2018
That's because there is a PGraphics object named g in the same class your code gets placed in - it's the thing you effectively draw on. And if you set that one to null, bad things will happen indeed.
Expected Behavior
Edit-time error: 'The variable 'g' does not exist.'
Current Behavior
No edit-time error. Sometimes run-time error: 'NulPointerException' (sic).
Steps to Reproduce
In an empty sketch, enter
on in a real sketch, accidentally include that statement out of scope of a declaration of g in the sketch.
Your Environment
3.3.6
Windows 7.
Possible Causes / Solutions
Processing's internal 'g' varaible leaking into the sketch's scope.
The text was updated successfully, but these errors were encountered: