Content deleted Content added
RProgrammer (talk | contribs) m →Object property dereferencing: idk, clearer; minor edit |
RProgrammer (talk | contribs) m might be confusing since direct array lookup would be [] not (), also style |
||
Line 11:
</source>
This code first looks in the
The problem with this approach is that the code assumes that all of these values exist. While it is reasonable to expect that a window will have a size and that size will have a width, it is not at all reasonable to assume that a window named "Main" will exist, nor that it has five subviews. If either of those possibilities are true, one of the methods will be invoked on null, producing a null pointer error.
|