Buggy code:
public class FindPath extends LeafTask { public FindPath ( String name , BlackBoard blackBoard ) { } @ Override public boolean check ( ) { } @ Override public void start ( ) { } @ Override public void update ( float delta ) { } @ Override public void end ( ) { } public LinkedList < Vector2 > getPath ( ) { boolean found = false ; Grid . PathNode target = null ; Grid . PathNode targetNode ; if ( ( this . blackBoard . targetNode ) != null ) targetNode = ( ( Grid . PathNode ) ( this . blackBoard . targetNode ) ) ; else if ( ( this . blackBoard . target ) != null ) targetNode = ( ( Grid . PathNode ) ( this . blackBoard . colonyGrid . getNode ( this . blackBoard . target ) ) ) ; else { this . control . finishWithFailure ( ) ; return new LinkedList < > ( ) ; } if ( targetNode == null ) { System . out . println ( ( ( this . blackBoard . getEntityOwner ( ) . name ) + "<seq2seq4repair_space>target<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ) ; this . control . finishWithFailure ( ) ; return null ; } LinkedList < Vector2 > path = new LinkedList < > ( ) ; ArrayDeque < Grid . PathNode > closedList = new ArrayDeque < > ( 20 ) ; PriorityQueue < Grid . PathNode > openList = new PriorityQueue < > ( ( n1 , n2 ) -> ( ( int ) ( ( ( n1 . getF ( ) ) - ( n2 . getF ( ) ) ) * 100 ) ) ) ; Grid . PathNode currNode = ( ( Grid . PathNode ) ( this . blackBoard . colonyGrid . getNode ( this . blackBoard . getEntityOwner ( ) ) ) ) ; currNode . parentNode = null ; currNode . G = 0 ; currNode . H = ( Math . abs ( ( ( targetNode . getCol ( ) ) - ( currNode . getCol ( ) ) ) ) ) + ( ( Math . abs ( ( ( targetNode . getRow ( ) ) - ( currNode . getRow ( ) ) ) ) ) * 10 ) ; currNode . visited = true ; while ( ( currNode != null ) && ( ! found ) ) { if ( currNode == targetNode ) { found = true ; target = currNode ; break ; } Grid [ ] neighbors = this . blackBoard . colonyGrid . getNeighbors8 ( currNode ) ; for ( Grid . Node neighbor : neighbors ) { Grid . PathNode node = ( ( Grid . PathNode ) ( neighbor ) ) ; if ( ( node == null ) || ( node . visited ) ) continue ; int [ ] dir = this . blackBoard . colonyGrid . getDirection ( node , currNode ) ; if ( ( ( dir [ 0 ] ) == 0 ) || ( ( dir [ 1 ] ) == 0 ) ) node . G = ( currNode . G ) + 10 ; else node . G = ( currNode . G ) + 20 ; WorldGen . TerrainTile tile = WorldGen . getInstance ( ) . getNode ( node . getCol ( ) , node . getRow ( ) ) ; if ( ( ( node . getEntityList ( ) . size ( ) ) > 0 ) || ( ( tile != null ) && ( tile . avoid ) ) ) node . B = 500 ; node . H = ( Math . abs ( ( ( targetNode . getCol ( ) ) - ( currNode . getCol ( ) ) ) ) ) + ( ( Math . abs ( ( ( targetNode . getRow ( ) ) - ( currNode . getRow ( ) ) ) ) ) * 10 ) ; node . visited = true ; openList . add ( node ) ; node . parentNode = currNode ; } closedList . add ( currNode ) ; if ( ( openList . size ( ) ) > 0 ) currNode = openList . remove ( ) ; else currNode = null ; } for ( Grid . PathNode node : closedList ) { node . visited = false ; node . B = 0 ; node . G = 0 ; node . H = 0 ; } for ( Grid . PathNode node : openList ) { node . visited = false ; node . B = 0 ; node . G = 0 ; node . H = 0 ; } float squareSize = this . blackBoard . colonyGrid . getSquareSize ( ) ; if ( found ) { currNode = target ; <START_BUG> while ( currNode != null ) { <END_BUG> path . add ( new Vector2 ( ( ( ( currNode . getCol ( ) ) * squareSize ) + ( squareSize * 0.5F ) ) , ( ( ( currNode . getRow ( ) ) * squareSize ) + ( squareSize * 0.5F ) ) ) ) ; currNode . visited = false ; currNode = currNode . parentNode ; } } closedList . clear ( ) ; openList . clear ( ) ; return path ; } }

Fix:
while ( ( currNode . parentNode ) != null ) {