"Orchid XP v7" <voi### [at] devnull> wrote in message
news:478fc569$1@news.povray.org...
> Gail Shaw wrote:
>
> > boolean hasShip() {
> > if (localShip!=null)
> > return true;
> > else
> > return false;
> > }
>
> This cannot possibly throw a null pointer exception.
Yeah, that's what I thought. Eclipse keeps giving me a null pointer excption
and pointing at that line.
Really odd thing is that the exception isn't halting execution.
> > Node currentNode = Universe.space[i][j]; // Have checked and this is
> never
> > null.
> > if (currentNode.hasShip()) { // <-- This line sometimes throws a
> > NullPointerException
>
> The only way for a null pointer exception to occur is if currentNode is
> null.
Which it's not. I have print statements checking that. Removed them from the
post for clarity
Post a reply to this message
|